|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38163 Problem in communication to http server using soap client of php
Submitted: 2006-07-20 14:43 UTC Modified: 2006-08-22 08:09 UTC
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: imthiazj2 at hcl dot in Assigned: dmitry (profile)
Status: Not a bug Package: SOAP related
PHP Version: 5.1.4 OS: Solaris
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: imthiazj2 at hcl dot in
New email:
PHP Version: OS:


 [2006-07-20 14:43 UTC] imthiazj2 at hcl dot in

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,
        "location" => $location,
        "login" => "root",
        "uri" => "urn:gsnmp",
        "password" => "12345678",
        "exceptions" => 1,
        "trace"    => 1,
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-20 14:54 UTC]
Please try using this CVS snapshot:
For Windows:

 [2006-07-24 09:48 UTC] imthiazj2 at hcl dot in

I used the php version of 5.2. But still the problem is existing and the whole apache is getting hang and not processing further request. It needs restart of the apache.

Can you please help me overcome this problem.

 [2006-07-25 09:23 UTC]
SoapClient::__doRequest() shouldn't return fault it should return SOAP response (XML representation).
Use SoapClient::__soapCall() instead and you will get fault.

BTW PHP shouldn't hang.
How does SOAP server respond?
(HTTP headers, timeouts, response body)
 [2006-07-25 14:57 UTC] imthiazj2 at hcl dot in
I don't connect to soap server, I connect it to http server.
Nothing is sent back to the php.
 [2006-07-26 10:12 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);

 [2006-07-27 10:06 UTC] imthiazj2 at hcl dot in
Still it gets hangup.
Is it possible to mention non-blocking mode of connection in soap request
 [2006-07-27 11:01 UTC]
Please run the following script from command line and provide output.

$server = stream_socket_server('tcp://');
$location = "";
$client = new SoapClient(NULL, array(
  "connection_timeout" => 4,
  "location" => $location,
  "uri" => "test://",
ini_set('default_socket_timeout', 2);
$result = $client->__doRequest("",$location,"",1,1);
$result = $client->__doRequest("",$location,"",1);
 [2006-07-27 12:01 UTC] imthiazj2 at hcl dot in
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:


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
 [2006-08-22 08:09 UTC]
Which version of PHP do you use?
The one-way operations are supported since php-5.1.4 and you reported that bug is in php-5.1.4, but SoapClient::__doRequest() accept 5 arguments in php-5.1.4.
So you probably use some old version that doesn't support one-way operations.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon May 25 09:01:25 2020 UTC