ZF-9125: connection_timeout option not supported in Zend_Soap_Client
Description
The code to implement a connection timeout is present but commented out in the Zend_Soap_Client.php file; support for connection timeout seems to work in the PHP Soap client - can this code be enabled?
Comments
Posted by Oliver Milanovic (ollim) on 2010-03-26T00:26:09.000+0000
Same question here. How can a timeout be enabled for Zend_Soap_Client?
Posted by David Abdemoulaie (hobodave) on 2010-08-10T11:09:41.000+0000
Bumping the priority on this. Is there any explanation as to why the connection timeout is explicitly ignored in Zend_Soap_Client? The soap library supports it. It's trivially simple to enable, but this gives me pause:
Why is this not used?
Posted by Kirill chEbba Chebunin (chebba) on 2010-11-08T23:35:47.000+0000
Bump. Also, it will be cool to have full support of timeout, I mean this note for SoapClient options. {quote} The connection_timeout option defines a timeout in seconds for the connection to the SOAP service. This option does not define a timeout for services with slow responses. To limit the time to wait for calls to finish the default_socket_timeout setting is available. {quote} And some other timeout features. I guess this information may be helpful http://darqbyte.com/2009/10/…
Posted by Marc van de Geijn (mvdgeijn) on 2011-05-25T09:02:20.000+0000
This issue still exists in Zend Framework 1.11.6. Does anybody know the reason why this is not fixed?
Posted by Tim Hunt (timhunt) on 2011-09-28T13:49:18.000+0000
No idea, but just to report the result of my investigations:
git history is useless. These lines of code seem not to have been changed since the initial check-in to git: https://github.com/zendframework/zf2/… commit e443b8c12a05ad49b9a583e17f1a08b9db2be267 0 parents Showing 6,457 changed files with 1,410,220 additions and 0 deletions.
Subversion is more helpful. This is the commit that changed this: http://framework.zend.com/code/revision.php/…. Argh, no, that is an irrelevant change ZF-4118.
And the previous change before that is http://framework.zend.com/code/revision.php/… / http://framework.zend.com/code/diff.php/… which is where the damage was really done. Commit message is "Zend_Soap_Client improvements" so that is nice and informative . No mention of any bug number.
This blog post explains the real issue: http://darqbyte.com/2009/10/…. Basically the SOAP connection_timeout does not actually do what you want. If you really want time-outs to work you have to do ini_set('default_socket_timeout', $timeout), but that is a global setting, so that is no good if you want time-outs on a per-client-class basis. The blog post also gives a possible solution, but it depends on curl.
I hope that information is of some help.
Posted by Michael Johansen (michael.johansen) on 2012-03-20T09:49:38.000+0000
After doing some googling on this issue including the very helpfull post at http://darqbyte.com/2009/10/… I have written a small but working version of this work around.
This could further be refined to just take the https calls and redirect them to curl as socket timeout in php seem to be a problem just for https. Hope this helps...
Posted by Adar Porat (hpman28) on 2012-05-25T19:31:13.000+0000
Bump. I had to extend Zend_Soap_Client to a custom class, as such: