1

i want to retrieve data from SOAP WSDL (PHP). But it always return this error

SoapFault exception: [HTTP] Error Fetching http headers in /home/myTest/public_html/test/test.php:30 Stack trace: #0 [internal function]: SoapClient->__doRequest('__soapCall('testCall', Array) #2 {main}

I already searched for the solution from google and SO, but it just didn't work for me. I followed this solution Set default_socket_timeout but nothing happened.

Here's my php code,

<?php
require_once('lib/nusoap.php');

try{
    ini_set("default_socket_timeout", 6000);

    $client=new SoapClient('https://www.example.com/wsdlexample/index.php?wsdl', 
    array("trace" => true,
    'connection_timeout' => 500000,
    'cache_wsdl' => WSDL_CACHE_BOTH,
    'keep_alive' => false));

    $params = array(
       "testParam1" => "abcd",
      "testParam2" => "efg"
    );


    $result=$client->__soapCall('testCall',array($params));

}catch (Exception $e){
    printf ( "Message = %s\n", $e->__toString () );
}
?>

Please let me know if you need more further information to solve this

Thanks in advance.

Community
  • 1
  • 1
Webster
  • 1,113
  • 2
  • 19
  • 39

1 Answers1

1

Solved it!!

Please refer to this link (I posted my answer in that link).

Thanks

Community
  • 1
  • 1
Webster
  • 1,113
  • 2
  • 19
  • 39