简体   繁体   English

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

[英]Fatal error: Uncaught SoapFault exception: [HTTP] Bad Request

I'm attempting to write a PHP script that will connect to the SOAP client for our SightMax interface. 我正在尝试编写一个PHP脚本,该脚本将连接到SightMax接口的SOAP客户端。 With the code below I am getting the the following error. 使用下面的代码,我得到以下错误。

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

This is a continuance of PHP Fatal error: "The SOAP action specified on the message, '', does not match the HTTP SOAP Action" where I wasn't specifying the SOAP Action header. 这是PHP致命错误的继续我未指定SOAP Action标头的消息“在消息上指定的SOAP操作与HTTP SOAP Action不匹配” I believe I am specifying the header now but alas a new error. 我相信我现在正在指定标题,但是会出现一个新错误。

try changing the version of soap, also you can try $client->__getTypes to see what structure is specting your WS. 尝试更改soap的版本,也可以尝试$ client-> __ getTypes来查看使用哪种结构来配置WS。

I have similar problem with my request: how to generate a soap request in php from this xml? 我的请求有类似的问题: 如何从此xml在php中生成soap请求?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM