致命错误:未捕获的SoapFault异常:[HTTP]错误请求

时间:2012-01-24 21:50:03

标签: php soap

我正在尝试编写一个PHP脚本,该脚本将连接到SightMax接口的SOAP客户端。使用下面的代码我收到以下错误。

<?php
$client = new SoapClient('http://domain.com/SightMaxWebServices/SightMaxWebService.svc?wsdl', array("soap_version" => SOAP_1_2));

$result = $client->__soapCall("GetSiteSummary", array(), array(), new soapHeader('action','SmartMax.SightMax.Agent.Operator/IRemotedWebsiteAdministrator/CreateCallQueue'));

echo "<pre>";
print_r($result);
echo "</pre>";

?>

Fatal error: Uncaught SoapFault exception: [HTTP] Bad Request in test2.php:5 Stack trace: #0 [internal function]: SoapClient->__doRequest('__soapCall('GetSiteSummary', Array, Array, Object(SoapHeader)) #2 {main} thrown in test2.php on line 5 

这是PHP Fatal error: "The SOAP action specified on the message, '', does not match the HTTP SOAP Action"的延续,我没有指定SOAP Action标头。我相信我现在正在指定标题但是还有一个新的错误。

1 个答案:

答案 0 :(得分:0)

尝试更改soap的版本,也可以尝试使用$ client-&gt; __ getTypes来查看构建WS的结构。

我的请求有类似的问题: how to generate a soap request in php from this xml?