I'm requesting a webservice using SOAP for which I need to set a request timeout.
new Zend_Soap_Client(http://www.aaa.com/ws/Estimate.asmx?wsdl",
array('encoding' => 'UTF-8');
I have also tried passing 'connection_timeout'=>100
but it seems like "unknow SOAP client option". Please suggest a way I can set the set timeout.
Thanks
I found a solution to set the timeout with Zend_Framework:
If you have your SoapClient-Object like this:
$client = new Zend_Soap_Client(http://www.aaa.com/ws/Estimate.asmx?wsdl", array('encoding' => 'UTF-8');
You can set the timeout for HTTP-Requests. The default timeout in PHP is 30 seconds. With the following code you can e.g. set it to 1 minute.
$context = stream_context_create(
array(
'http' => array(
'timeout' => 1000
)
)
);
$client->setStreamContext($context);
Found on downlifesroad.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With