I'm using PHP's built-in SoapClient, and it needs to time out after 5 seconds. Therefore I'm using ini_set("default_socket_timeout", 5);
. However, when fetching the WSDL it times out after 10 seconds instead. If I change the default socket timeout to i.e. 1 second it times out after 2 and so on. The actual soap calls time out after 5 seconds as expected though.
Is this a bug in PHP, expected behaviour or is there some additional setting I need to change? Using PHP 5.6.28.
Thanks!
There is an additional timeout setting that you will want to change:
connection_timeout
which is passed to the SoapClient in the $options array parameter. This timeout controls how long the SoapClient waits (in seconds) to connect to the Soap service, which is what you are looking for.Usage:
Once connected,
"default_socket_timeout"
comes into play and controls how long the SoapClient waits for a response.