|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38331 Call timeout when the response is chunked
Submitted: 2006-08-04 14:08 UTC Modified: 2017-10-24 07:52 UTC
Avg. Score:4.4 ± 0.8
Reproduced:11 of 11 (100.0%)
Same Version:2 (18.2%)
Same OS:3 (27.3%)
From: ulhin at tdc dot dk Assigned:
Status: Open Package: SOAP related
PHP Version: 5.1.4 OS: Red Hat Enterprise Linux 4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: ulhin at tdc dot dk
New email:
PHP Version: OS:


 [2006-08-04 14:08 UTC] ulhin at tdc dot dk
There seems to no way to abort a soap call when the response is chunked and none of the chunks exceed the timeout specified with ini_set('default_socket_timeout', 3).

Reproduce code:
###### File: client.php
ini_set('default_socket_timeout', 3);
$client = new SoapClient(NULL,
	    "location" => "", "uri" => "urn:xmethods-delayed-quotes", "style" => SOAP_RPC, "use" => SOAP_ENCODED, "trace" => 1, "connection_timeout" => 3
$response = ' [NO RESPONSE] ';
try {
	$response = $client->__call(
	    array(new SoapParam("ibm", "symbol")),
	    array("uri" => "urn:xmethods-delayed-quotes", "soapaction" => "urn:xmethods-delayed-quotes#getQuote")
} catch(Exception $e) {	print "Exception: " . $e->getMessage(); }
print $response;

###### File: server.php
	print '<?xml version="1.0" encoding="UTF-8"?>';
	for ($i=0; $i<20; $i++) {
		print "<!-- $i -->";
		flush(); // The client will wait 20 seconds for the response. Without flush the client will drop the request after 3 seconds.
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="" SOAP-ENV:encodingStyle="">
                        <Result xsi:type="xsd:float">198.4234</Result>

Expected result:
The call duration should be about 3 seconds.

Actual result:
The actual call duration is 20 seconds.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-04 14:10 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-08-04 19:07 UTC] schack at tdconline dot dk
No change with

Timeout is still not working.
 [2006-08-07 11:44 UTC]
This is not a bug.
"default_socket_timeout" sets timeout for single read() call. ext/soap breaks reading if nothing was received from server in "default_socket_timeout", but it doesn't assume that whole resonse must be read before it exceeded.
 [2006-08-08 19:13 UTC]
This is not a bug but feature request.
SoapClient needs additional option "request_timeout" (in additional to "connection_timeout").
 [2010-12-20 14:16 UTC]
-Summary: SOAP call timeout when the response is chunked +Summary: Call timeout when the response is chunked -Package: Feature/Change Request +Package: SOAP related
 [2017-10-24 07:52 UTC]
-Status: Assigned +Status: Open -Assigned To: dmitry +Assigned To:
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 25 12:01:31 2024 UTC