简体   繁体   中英

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

I have similar problem with my request: how to generate a soap request in php from this xml?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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