1

需要使用soapclient访问网络服务。我有以下设置。

ini_set('default_socket_timeout', 120);
$client = new SoapClient(
  "http://example.com/OnlineOrderProcessingWS.asmx?WSDL",
  array('proxy_host'    => "proxy url",
        'proxy_port'    => proxy port
  )
);
$param=array("varname1"=>'value1',"varname2"=>'value2');

$result = $client->CustomerOrder($param);
print_r($result); 

执行这个脚本抛出

致命错误:未捕获的 SoapFault 异常:[HTTP] 获取 http 标头时出错。

4

1 回答 1

1

The most common reason for this error seems to be a timeout while waiting on the service response. You already adjust your socket_timeout to 120, but might want to try an even higher value. How long does it take for the error to be returned?

于 2010-05-21T06:50:32.133 回答