I am working on an API Script for a client, and one of the services they need the request made to wants the content length. As far as I was aware, PHP cannot send the Content-Length in the header. I could be wrong but, without it, I keep getting Premature end of data in tag html line 3 [string:Exception:private] => [code:protected] => 0 [file:protected] =>
The code looks 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);
}