|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-20 14:43 UTC] imthiazj2 at hcl dot in
Description:
------------
Hi,
I am connecting a http server, using soap client.Since the http server is not responding, the soap client remains connecting to it.So the apache port becomes in time_wait and it stops listening from further request. It leads to a situation where the apache has to be restarted.
It is similar to 33765, but here the server is not responding, so the apache hangs
Reproduce code:
---------------
$client = new SoapClient(NULL,
array(
"location" => $location,
"login" => "root",
"uri" => "urn:gsnmp",
"password" => "12345678",
"exceptions" => 1,
"trace" => 1,
"features"=>SOAP_WAIT_ONE_WAY_CALLS
));
ini_set('default_socket_timeout', 10)
$result = $client->__doRequest("",$locationwithdata,"",1);
Expected result:
----------------
The soap client should wait for few seconds and returns error or soap fault.
So that it should avoid from apache hanging.
Actual result:
--------------
It makes apache server to hang and needs to restart for processing further request
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
I cannot reproduce hangup. 1. May be your web server runs just one process and cannot accept connection. Try to add "connection_timeout" into SoapClient constructor. $client = new SoapClient(NULL, array("connection_timeout => 10, ... 2. In case if you are calling one-way operation without response, you should add additional argument (one_way operation) to __doRequest() call. result = $client->__doRequest("",$locationwithdata,"",1,1);Please run the following script from command line and provide output. <?php $server = stream_socket_server('tcp://127.0.0.1:31337'); $location = "http://127.0.0.1:31337/"; $client = new SoapClient(NULL, array( "connection_timeout" => 4, "location" => $location, "uri" => "test://", "features"=>SOAP_WAIT_ONE_WAY_CALLS)); ini_set('default_socket_timeout', 2); $result = $client->__doRequest("",$location,"",1,1); var_dump($result); $result = $client->__doRequest("",$location,"",1); var_dump($result); $client->test(); fclose($server); ?>Warning: SoapClient::__doRequest() expects exactly 4 parameters, 5 given in /home/amudha/B16/galad/apache/htdocs/faultperf/l/php/a.php on line 11 Fatal error: SoapClient::__doRequest(): Invalid parameters in /home/amudha/B16/galad/apache/htdocs/faultperf/l/php/a.php on line 11 After correcting the error: NULL NULL Fatal error: Uncaught SoapFault exception: [HTTP] Error Fetching http headers in /home/amudha/B16/galad/apache/htdocs/faultperf/l/php/a.php:15 Stack trace: #0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'http://127.0.0....', 'test://#test', 1) #1 [internal function]: SoapClient->__call('test', Array) #2 /home/amudha/B16/galad/apache/htdocs/faultperf/l/php/a.php(15): SoapClient->test() #3 {main} thrown in /home/amudha/B16/galad/apache/htdocs/faultperf/l/php/a.php on line 15