Req #38331 [Asn->Opn]: Call timeout when the response is chunked
| From: | kalle@php.net | Date: | Tue, 24 Oct 2017 07:52:53 +0000 |
| Subject: | Req #38331 [Asn->Opn]: Call timeout when the response is chunked | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212176@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=38331&edit=1
ID: 38331
Updated by: kalle@php.net
Reported by: ulhin at tdc dot dk
Summary: Call timeout when the response is chunked
-Status: Assigned
+Status: Open
Type: Feature/Change Request
Package: SOAP related
Operating System: Red Hat Enterprise Linux 4
PHP Version: 5.1.4
-Assigned To: dmitry
+Assigned To:
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2006-08-08 19:13:53] dmitry@php.net
This is not a bug but feature request.
SoapClient needs additional option "request_timeout" (in additional to
"connection_timeout").
------------------------------------------------------------------------
[2006-08-07 11:44:14] dmitry@php.net
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-04 19:07:07] schack at tdconline dot dk
No change with http://snaps.php.net/php5.2-latest.tar.gz
(php5.2-200608041430)
Timeout is still not working.
------------------------------------------------------------------------
[2006-08-04 14:10:53] tony2001@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
------------------------------------------------------------------------
[2006-08-04 14:08:40] ulhin at tdc dot dk
Description:
------------
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,
array(
"location" => "http://foobar.dk/soap/server.php",
"uri" => "urn:xmethods-delayed-quotes", "style" => SOAP_RPC,
"use" => SOAP_ENCODED, "trace" => 1, "connection_timeout" =>
3
)
);
$response = ' [NO RESPONSE] ';
try {
$response = $client->__call(
"getQuote",
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
<?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.
sleep(1);
}
?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:xmethods-delayed-quotes" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:getQuoteResponse>
<Result xsi:type="xsd:float">198.4234</Result>
</ns1:getQuoteResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Expected result:
----------------
The call duration should be about 3 seconds.
Actual result:
--------------
The actual call duration is 20 seconds.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=38331&edit=1