Php 使用nusoap返回故障代码

Php 使用nusoap返回故障代码,php,soap,nusoap,Php,Soap,Nusoap,使用nusoap调用web服务方法将返回错误 array(3) { ["faultcode"]=> string(11) "soap:Client" ["faultstring"]=> string(516) "System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protoc

使用nusoap调用web服务方法将返回错误

array(3) { ["faultcode"]=> string(11) "soap:Client" ["faultstring"]=> string(516) "System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: . at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)" ["detail"]=> string(0) "" } 
是我的电话故障还是soap服务器故障

    $response = $qes->call('GetXhtml',$url);

    var_dump($response);
上面是对函数的调用,该函数接受1个参数($url),我已将其检查为有效

-------完整代码-----


Nusoap提出的实际完整请求:

POST/swindon/ppa/uat/contentserver/contentserver/contentserver.asmx HTTP/1.1
主持人:www.qes24.com
用户代理:NuSOAP/0.9.5(1.123)
连接:关闭
内容类型:text/xml;字符集=utf-8
SOAPAction:“http://tempuri.org/GetXhtml"
内容长度:516
UTF-8http://localhost/waggleb/?Type=8AFCCCB9-93DC-421E-A617-92A990EC99A7
全部答复:

HTTP/1.1200正常
日期:2011年2月7日星期一10:50:25 GMT
服务器:Microsoft IIS/6.0
X-Powered-By:ASP.NET
X-AspNet-Version:2.0.50727
缓存控制:专用,最大年龄=0
内容类型:text/xml;字符集=utf-8
内容长度:329

根据返回的错误,我猜(但如果不知道您要使用哪个API,我无法确定)问题在于方法名。也许它的情况不正确?无论哪种方式,这都意味着服务器无法将SOAP请求定向到正确的模块。

-->这是服务OK,基于此,它应该可以工作。它似乎在正确的外壳里。你能把剩下的代码贴出来吗?这可能与您设置SoapClient的方式有关。现在有点不同,但仍然不起作用(得到200个,但没有结果)。根据提供者和我的全部代码,我已经包括了合同应该是什么样的。你有一些代码可以输出完整的请求和完整的响应:你能从中粘贴输出吗?将您发送的内容与实际的预期请求进行比较会很有趣。除此之外,我还看到了使用nusoap时出现的一些问题-您是否仍坚持使用PHP4?否则,我建议切换到PHP5中的内置SoapClient支持。如您所见,调用成功,但结果为空(它们应该包含html表单)
<?php
//include nusoap class
require 'extensions/nusoap/lib/nusoap.php';

//connect to QES
$qes = new nusoap_client("https://www.qes24.com/swindon/ppa/uat/contentserver/contentserver/contentserver.asmx");
$qes->useHTTPPersistentConnection();
$qes->soap_defencoding = 'utf-8'; 

//check connection
$error = $qes->getError();

//get current page
$curl = curPageURL();//function derives current URL
$furl = $curl."?Type=8AFCCCB9-93DC-421E-A617-92A990EC99A7";
$param = array('url' => $furl);



$response = $qes->call('getXhtml', $param, '','http://tempuri.org/GetXhtml', array('content-type' => 'UTF-8'), true,null,'rpc','literal');

fb::log($response);

// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($qes->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($qes->response, ENT_QUOTES) . '</pre>';

//*/
POST /swindon/ppa/uat/ContentServer/ContentServer/ContentServer.asmx HTTP/1.1
Host: www.qes24.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/GetXhtml"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetXhtml xmlns="http://tempuri.org/">
      <url> http://localhost/waggleb/?Type=8AFCCCB9-93DC-421E-A617-92A990EC99A7</url>
    </GetXhtml>
  </soap:Body>
</soap:Envelope>
    ?>
POST /swindon/ppa/uat/contentserver/contentserver/contentserver.asmx HTTP/1.1
Host: www.qes24.com
User-Agent: NuSOAP/0.9.5 (1.123)
Connection: close
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/GetXhtml"
Content-Length: 516

<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Header><content-type xsi:type="xsd:string">UTF-8</content-type></SOAP-ENV:Header><SOAP-ENV:Body><url xsi:type="xsd:string">http://localhost/waggleb/?Type=8AFCCCB9-93DC-421E-A617-92A990EC99A7</url></SOAP-ENV:Body></SOAP-ENV:Envelope>
    HTTP/1.1 200 OK
Date: Mon, 07 Feb 2011 10:50:25 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 329

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetXhtmlResponse xmlns="http://tempuri.org/"><GetXhtmlResult /></GetXhtmlResponse></soap:Body></soap:Envelope>