2011-02-02 156 views
0

在我的呼唤或与SOAP服务器进行调用Web服务方法用的NuSOAP返回错误使用的NuSOAP返回错误代码

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) "" } 

是错?

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

    var_dump($response); 

上面是对函数的调用,它接受1个参数($ url),我已经检查了它的有效性。

-------全码-----

<?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> 
    ?> 

实际完全请求由作出的NuSOAP:

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> 

回答

1

从返回的错误,我猜(但我不能确定不知道你正在尝试使用哪个API)问题是方法名称。也许它是不正确的吗?无论哪种方式,这意味着服务器无法将SOAP请求定向到正确的模块。

+0

https://www.qes24.com/swindon/ppa/uat/contentserver/contentserver/contentserver.asmx - >这里是服务 – 2011-02-02 12:36:15