PHP Fatal error: “The SOAP action specified on the message, '', does not match the HTTP SOAP Action”

后端 未结 2 653
清酒与你
清酒与你 2020-12-07 02:30

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 able to print out a list of functions availa

2条回答
  •  情话喂你
    2020-12-07 03:14

    WCF seems to be looking for the action in the SOAP envelope. You can add it to your call with PHP's SoapClient this way:

    $actionHeader = new SoapHeader('http://www.w3.org/2005/08/addressing',
                                   'Action',
                                   'http://soapaction.that.was.in.the.wsdl');
    $client->__setSoapHeaders($actionHeader);
    

    If you change the third parameter and add that between your instantiation of $client and the __call() it should clear the error (and possibly bring on new ones, isn't SOAP fun?)

    Also FYI, having just gone through this same problem, I found the __getLastRequestHeaders(), __getLastRequest(), __getLastResponseHeaders(), and __getLastResponse() functions very handy to see if what I was trying had any effect (note that you need to add "trace" => "1" to your SoapClient options for those to work.)

提交回复
热议问题