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.

1 Answer 1

1

Solved it!!

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

Thanks

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.