4
我正在为客户端开发一个API脚本,并且他们需要其中一个服务来请求所需的内容长度。据我所知,PHP无法发送头中的Content-Length。我可能是错的,但是,如果没有它,我不断收到Premature end of data in tag html line 3 [string:Exception:private] => [code:protected] => 0 [file:protected] =>
PHP SOAP请求
的代码如下:
<?
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);
}