Error fetching http headers in SoapClient

前端 未结 15 1007
抹茶落季
抹茶落季 2020-12-08 18:50

I\'m trying to invoke a WS over https on a remote host:remote port and I get:

Error fetching http headers

using the PHP5 SoapCli

相关标签:
15条回答
  • 2020-12-08 19:27

    Another possible cause of this error could be some OpenSSL operations leaving not cleared errors. Put this piece of code before the SOAP request to clear them:

    while (openssl_error_string()) {}
    
    0 讨论(0)
  • 2020-12-08 19:28

    Setting 'keep_alive' to false worked for me:

    new SoapClient($api_url, array('keep_alive' => false));
    
    0 讨论(0)
  • 2020-12-08 19:33

    The configuration that has worked for me was defining at my php script the following parameters:

    ini_set('default_socket_timeout', 5000);
    $client = new \SoapClient($url,array(
        'trace' =>true,
        'connection_timeout' => 5000,
        'cache_wsdl' => WSDL_CACHE_NONE,
        'keep_alive' => false,
    ));
    

    Please, comment.

    The most important parameter definition, as per my experience with this issue was

    ini_set('default_socket_timeout', 5000);
    

    During my tests I have defined the default_socket_timeout to 5 seconds and the error 'Error Fetching http headers' was raised instantaneously.

    I hope it helps you!

    0 讨论(0)
提交回复
热议问题