NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
socket read of headers timed out


Joined: 29 Jun 2006
Posts: 20
Reply with quote
Hi,

im running a nusoap server. i can access the service i am providing quite fine. it reas data from a database and returns it. but once the data ist getting a little more (~900 rows) i get a "HTTP Error: socket read of headers timed out" in the client as return.

these are the last lines from the debug:
Code:


2006-06-29 14:57:52.340844 soap_transport_http: wrote data to socket, length = 778
2006-06-29 14:58:22.337811 soap_transport_http: read line of 0 bytes:
2006-06-29 14:58:22.338156 soap_transport_http: socket read of headers timed out after length 0
2006-06-29 14:58:22.338302 soap_transport_http: read before timeout:
2006-06-29 14:58:22.338432 soap_transport_http: end of send()
2006-06-29 14:58:22.338793 soapclient2: Error: HTTP Error: socket read of headers timed out



are there any limitations to how long the processing of a service call can take? i am a bit clueless now. i will be in need to return 2000+ rows from the database. or would this be even a limitation to the webserver the soap-server is running on?

i hope anybody can give me a hint what to do.

Doc Olson
View user's profileFind all posts by Doc OlsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
yes threre are two timeouts - connection timeout and responce timeout. Both can be set in the soapclient() constructor call.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jun 2006
Posts: 20
Reply with quote
Hi,

i tried those but there is no change in behaviour. I set $timeout = 600 and $response_timeout = 600 just to see if there is any change at all. In my desperation i even changed the default timeout values in the nusoap.php file.
Nothing helped at all. It returns the error way before the given timeouts (after ~24 seconds).
I am also using the WSDL functionality, but i also set those timeout values high.

this is what i get:
Code:

(...)
2006-06-30 09:28:04.293674 soap_transport_http: entered send() with data of length: 587
2006-06-30 09:28:04.293810 soap_transport_http: connect connection_timeout 600, response_timeout 600, scheme http, host soap.myserver, port 80
2006-06-30 09:28:04.293936 soap_transport_http: calling fsockopen with host soap.myserver connection_timeout 600
2006-06-30 09:28:04.294970 soap_transport_http: set response timeout to 600
2006-06-30 09:28:04.295245 soap_transport_http: socket connected
2006-06-30 09:28:04.295437 soap_transport_http: set Content-Length: 587
2006-06-30 09:28:04.295584 soap_transport_http: HTTP request: POST /soap.php HTTP/1.0
2006-06-30 09:28:04.295714 soap_transport_http: HTTP header: Host: soap.myserver
2006-06-30 09:28:04.295836 soap_transport_http: HTTP header: User-Agent: NuSOAP/0.7.2 (1.94)
2006-06-30 09:28:04.295950 soap_transport_http: HTTP header: Content-Type: text/xml; charset=ISO-8859-1
2006-06-30 09:28:04.296066 soap_transport_http: HTTP header: SOAPAction: "urn:artikel#getItems"
2006-06-30 09:28:04.296183 soap_transport_http: HTTP header: Content-Length: 587
2006-06-30 09:28:04.338676 soap_transport_http: wrote data to socket, length = 778
2006-06-30 09:28:48.183627 soap_transport_http: read line of 0 bytes:
2006-06-30 09:28:48.184016 soap_transport_http: socket read of headers timed out after length 0
2006-06-30 09:28:48.184138 soap_transport_http: read before timeout:
2006-06-30 09:28:48.184274 soap_transport_http: end of send()
2006-06-30 09:28:48.184605 soapclient2: Error: HTTP Error: socket read of headers timed out



client

Code:

$client = new soapclient2('http://soap.myserver/soap.php?wsdl', true, false, false, false, false, 600, 600);

am i doing anything wrong?
View user's profileFind all posts by Doc OlsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
It looks like your serever did not return any data but closed connection.
timeout won't help, check server logs.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jun 2006
Posts: 20
Reply with quote
Code:

82.XXX.XXX.XXX - - [30/Jun/2006:16:06:30 +0200] "GET /soap.php?wsdl HTTP/1.1" 200 8072 "-" "NuSOAP/0.7.2 (1.94)"
85.XXX.XXX.XXX - - [30/Jun/2006:16:06:30 +0200] "GET /client.php HTTP/1.1" 200 37484 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4"


the error log is empty. Sad
View user's profileFind all posts by Doc OlsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
try to run http://yourhost/soap.php?wsdl directly in the browser.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jun 2006
Posts: 20
Reply with quote
we just beat argentina... need to party a bit now.
will do some further investigation tomorrow (e.g. try without wsdl, if that could be a cause)
View user's profileFind all posts by Doc OlsonSend private message


Joined: 29 Jun 2006
Posts: 20
Reply with quote
hi again,

i just removed wsdl functionality... now it works. no error. i will see if i can make the service user live without wsdl. but i think i'll need it.
any clue what could be the cause?
View user's profileFind all posts by Doc OlsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
it depends.
What if the server changes WSDL?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jun 2006
Posts: 20
Reply with quote
im not sure if i know what you mean.

i create the server with:
Code:

$server = new soap_server();
$server -> configureWSDL('artikel', 'urn:artikel');

$server -> wsdl -> addComplexType('items', 'complexType', 'struct', 'all', '',
                      array('item_id' => array('name' => 'item_id', 'type' => 'xsd:string')...
(...)put all the type definitions here(...)

// register services...
$server -> register('getItems', // method name
array('auth' => 'tns:auth'), // input parameters
array('items' => 'tns:item_array'), // output parameters
'urn:artikel', // namespace
'urn:artikel#getItems', // soapaction
'rpc', // style
'encoded', // use
'returns all items' // documentation
);

(...) more services here(...)



client:
Code:

$client = new soapclient2('http://soap.myserver/soap.php?wsdl', true);


thats how it does NOT work. at least not if 'getItems' returns LOTS of data (2000+ Items). with only a couple of hundred items there is no problem.

This is the server without wsdl:
Code:

$server = new soap_server();

$server -> register('addTransaction');
$server -> register('getInventories');
$server -> register('getItems');



runs fine with client:

Code:

$client = new soapclient2('http://soap.myserver/soap.php');


unfortunately the wsdl description is needed for the other side to create their client. as far as i get the idea, wsdl does only describe the types of data needed for the service and enforces their presence/format.
View user's profileFind all posts by Doc OlsonSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8342
Reply with quote
Oh, sorry I didn't get you right.
You can try to cache WSDL on the client and do not request it each time your make a call.
Regarding "timeout", I'd highly recommend to dump out server object immediately after such failured call.
Maybe it's server closes connection and does not output anything.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 29 Jun 2006
Posts: 20
Reply with quote
Hi,

sorry for the delayed answer. I solved the problem by only adding the wsdl functionality when the GET parameter "wsdl" is passed. Otherwise it will run without wsdl which is ok as wsdl is only needed for the client creation.
View user's profileFind all posts by Doc OlsonSend private message
socket read of headers timed 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