Error fetching http headers in SoapClient

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

    This error is often seen when the default_socket_timeout value is exceeded for the SOAP response. (See this link.)

    Note from the SoapClient constructor: the connection_timeout option is used for defining a timeout value for connecting to the service, not for the timeout for its response.

    You can increase it like so:

    ini_set('default_socket_timeout', 600); // or whatever new value you want
    

    This should tell you if the timeout is the issue, or whether you have a different problem. Bear in mind that you should not use this as a permanent solution, but rather to see if it gets rid of the error before moving on to investigate why the SOAP service is responding so slowly. If the service is consistently this slow, you may have to consider offline/batch processing.

提交回复
热议问题