views:

60

answers:

1

Hi, Need to access a webservice using soapclient.I have the following settings.

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); 

Executing this script throwing Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers. How to fix this issue. Please anyone help.

+1  A: 

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?

Henrik Opel