NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] NuSoap timing out


Joined: 25 Feb 2008
Posts: 4
Reply with quote
Hi.

Im having problems with NuSoap timing out if the returned value(of type xsd:string) is bigger than X bytes. It is definitely not an issue with slow execution. There seems to be a spot where it goes from working well to just hanging. Any ideas what could cause this?

Code:
2008-02-25 14:24:57.463890 soap_transport_http: set response timeout to 30
2008-02-25 14:24:57.464019 soap_transport_http: socket connected
2008-02-25 14:24:57.464115 soap_transport_http: HTTP request: POST getMembers.php HTTP/1.0
2008-02-25 14:24:57.464177 soap_transport_http: HTTP header: Host: test.com
2008-02-25 14:24:57.464232 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.0 (1.90)
2008-02-25 14:24:57.464289 soap_transport_http: HTTP header: Content-Type: text/xml; charset=ISO-8859-1
2008-02-25 14:24:57.464343 soap_transport_http: HTTP header: SOAPAction: "http://test.com/#getMembers"
2008-02-25 14:24:57.464397 soap_transport_http: HTTP header: Authorization: Basic
2008-02-25 14:24:57.464454 soap_transport_http: HTTP header: Content-Length: 949
2008-02-25 14:24:57.464577 soap_transport_http: wrote data to socket, length = 1245
2008-02-25 14:25:57.456451 soap_transport_http: read line of 0 bytes:
2008-02-25 14:25:57.456563 soap_transport_http: socket read of headers timed out after length 0
2008-02-25 14:25:57.456614 soap_transport_http: read before timeout:
2008-02-25 14:25:57.456675 soap_transport_http: end of send()
2008-02-25 14:25:57.456901 soapclient: Error: HTTP Error: socket read of headers timed out
View user's profileFind all posts by SilenosSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
2008-02-25 14:24:57.464577 soap_transport_http: wrote data to socket, length = 1245
2008-02-25 14:25:57.456451 soap_transport_http: read line of 0 bytes:

it waited for 1 minute and returned timeout. You may want to check your firewall or URL.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Feb 2008
Posts: 3
Reply with quote
This only happens with a certain amount of bytes though, and if less bytes are sent then everything works very fast (same service, same URL etc). Wouldn't that exclude problems related to the firewall and URL?
View user's profileFind all posts by Silen0sSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
then you may want to check your server if it can response within timeout you specified.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Feb 2008
Posts: 4
Reply with quote
for testing I generate a random string of X bytes. when I return a string of 15275 bytes everything works okay, but when I return a string of 15276 bytes the call times out. the service returns immediately(by looking at apache logs), so it seems like a client side problem. could this be related to a "chunk size" of 16K ?
View user's profileFind all posts by SilenosSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Quote:
the service returns immediately(by looking at apache logs),

if it returns immediately, the problem is definitely on the server. Do you use nusoap on both server and client sides or only on the client?

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Feb 2008
Posts: 4
Reply with quote
dmitri wrote:
Quote:
the service returns immediately(by looking at apache logs),

if it returns immediately, the problem is definitely on the server. Do you use nusoap on both server and client sides or only on the client?

I use nusoap on both server and client. the service doesnt time out, but the client does.
View user's profileFind all posts by SilenosSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
so you need to inspect nusoap log on the server to check why nothing is sent to the client

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Feb 2008
Posts: 3
Reply with quote
When testing with soapUI, the service returns expected data within reasonable time.. this would suggest that there is nothing wrong with the server side, right?

Do you know of any limits that could cause this problem? We notice several other users asking the same question in this and other forums.. we haven't seen anyone get a good answer yet
View user's profileFind all posts by Silen0sSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
I'd highly appreciate if you post a sample that will demonstarate the problem.
and no, I do now know any limitations like that. You can check this yourself, nusoap is opensource.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 25 Feb 2008
Posts: 4
Reply with quote
Sample server(from the hello world example):
Code:
<?php
// Pull in the NuSOAP code
require_once('../classes/nusoap/nusoap.php');
// Create the server instance
$server = new soap_server;
// Register the method to expose
$server->register('hello');
// Define the method as a PHP function
function hello($name) {
   $str = '';
   //generate random string with X bytes
   for($i = 0; $i < 15242; $i++) $str .= chr(65 + rand(0, 30));
   return $str;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>


Sample client:
Code:
<?php
// Pull in the NuSOAP code
require_once('../classes/nusoap/nusoap.php');
// Create the client instance
$client = new soapclient('test_server.php');
// Call the SOAP method
$result = $client->call('hello', array('name' => 'Scott'));
// Display the result
print_r($result);
?>


A string length of 15241 works, but when I change it to 15242 it times out.
View user's profileFind all posts by SilenosSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Your sample works fine. It must be something wrong with your firewall. Check on a clean machine.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
[resolved] NuSoap timing out
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 2  

  
  
 Reply to topic