Error fetching http headers in SoapClient

前端 未结 15 1039
抹茶落季
抹茶落季 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: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!

提交回复
热议问题