ID: 48524 Comment by: maximchick at gmail dot com Reported By: valer_crisan at yahoo dot com Status: Open Bug Type: SOAP related Operating System: Linux PHP Version: 5.2.9 New Comment:
Found the same behaviour: when connecting to SOAP server over http, default_socket_timeout works as expected, but with HTTPS client hangs forever. stream_context_create with timeout and connection_timeout options for SSL wrapper also not works. Previous Comments: ------------------------------------------------------------------------ [2009-09-09 11:03:27] sjo...@php.net See also bug #41631 ------------------------------------------------------------------------ [2009-07-07 17:58:03] akomasinski at gmail dot com I am seeing the same issue on PHP 5.3.0 on windows and linux. The issue seems to be exactly as described. ------------------------------------------------------------------------ [2009-06-10 19:06:43] valer_crisan at yahoo dot com Description: ------------ The default_socket_timeout option is not taken in consideration when making SOAP requests to a HTTPS URL. This causes big issues for us because, if the server hung for some reason, the client waits forever to get a reply back. The code works correctly when using HTTP URLs. But in our production environment we need to use HTTPS so this is not a workaround. Reproduce code: --------------- SOAP Server code: $Server = new SoapServer('ed.wsdl'); $Server->setClass('Ed'); $Server->handle(); class Ed{ public function hello($Input){ sleep(30); return array('goodbye' => "Goodbye " . $Input->firstname); } } SOAP client code: echo "Start time: " . date('c') . "\n"; ini_set('soap.wsdl_cache_enabled', 0); ini_set('default_socket_timeout', 5); $Binding = new SoapClient('ed.wsdl', array('trace' => 1)); try { $Return = $Binding->hello(array('firstname' => 'john')); echo "Response: "; print_r($Return); } catch( Exception $e ) { echo "Exception: "; print_r($e); } echo "End time: " . date('c') . "\n"; Let me know if you need the wsdl file as well. Expected result: ---------------- I expect a SOAP timeout exception to be thrown. Actual result: -------------- The client gets the server response after 30 seconds, as shown here: Start time: 2009-06-10T11:58:30-07:00 Response: stdClass Object ( [goodbye] => Goodbye john ) End time: 2009-06-10T11:59:00-07:00 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48524&edit=1