PHP SOAP Requests

I am working on a Script API for a client, and one of the services in which they need a request that requires a length of content. To my knowledge, PHP cannot send Content-Length to the header. I could be wrong, but without it I continue to receive Premature end of data in tag html line 3 [string:Exception:private] => [code:protected] => 0 [file:protected] =>

The code is as follows:

 <? try { $soap_url = 'http://admin.stock.imdfulfilment.com/api/service.asmx'; $client = new SoapClient($soap_url); $header = new SoapHeader( 'http://admin.stock.imdfulfilment.com/api/service/', 'GetCouriers', array( 'Content-Length' => '255' ) ); $client->__setSoapHeaders($header); var_dump($client->__getFunctions()); } catch (Exception $e) { print_r($e); } 
+4
source share
1 answer

Your wsdl uri is not for the wsdl file, this is the problem ... Use http://admin.stock.imdfulfilment.com/api/service.asmx?wsdl

+11
source

All Articles