You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rene Mondeel <Re...@rivm.nl> on 2007/11/26 12:11:19 UTC

Timeout too short, but which one?

Hi all,
I have just developed "my first webservice" containing two methods.
The first method does a search in a Lucene index and works OK.
The second method builds the Lucene index and does not work OK.

Some context: I use Axis 1.4 and Tomcat 5.5.25 both on Sun Java 1.5.0_13.
(Yes, I am a conservative :-)

I have found the following:
"Does not work OK" has as a symptom that there is no return SOAP-message
(TCPIP-monitor in Eclipse), the index gets built.
A difference between the two methods is that the indexing takes longer to
complete, in the order of fifteen seconds. Before I started the same
process from a JSP and encountered no problems.
I replaced the indexing with a sleep() call of the same duration and the
problem persisted, so the indexing is not at fault.
Another difference is in the parameters, doSearch uses XML documents for
request and response, createIndex Strings. I think this is not relevant.
I kicked the logging up to the debug level and upto the second
AxisServlet.doPost timing log (after the construction of the SOAPPart)
everything seems to be identical for both methods.

I tried letting my method sleep() with incrementing duration from 1 second
with steps of 1 second. 10 seconds returned, 11 did not.

Now my question: What timeout can I set where to allow for the method to
complete? (the client waits long enough anyway:-)

Thanx,
René Mondeel


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Timeout too short, but which one?

Posted by "Walker, Jeff" <Je...@fmr.com>.
So,
I think the way this is supposed to work is, is that the client is in charge of how long the process should take before abandoning the web service call. To that end, it can set the timeout on the Call object (per request timeout) or on the Stub object (allowing for multiple calls using the same Stub to all have the same timeout value, something like a session timeout).

If you want to control timeouts on the server side, then you can call setTimeout() in the MessageContext object. You'd have to do it immediately upon receiving the request from the client, so I'd create a request handler class to do it. (All handler classes get a reference to the MessageContext passed to them). The only issue here, is that the timeout may have already been set by Axis. So if you change it again in a handler class, then there is some timelag between what has already ticked away and what you think the new tinmeout value will be. I haven't tried this, but it should be an easy thing to test. If you want to do it in a non-web services sort of way, you could create a Java.util.Timer upon receiving the request and then if the timer goes off, you basically abandon the processing in your impl class and send the response back to the client. (Kind of messy).

One more thing, I think Tomcat has a default timeout on port 8080 in its server.xml file. You might want to check what that value is for you.
-jeff


-----Original Message-----
From: Rene Mondeel [mailto:Rene.Mondeel@rivm.nl] 
Sent: Monday, November 26, 2007 6:11 AM
To: axis-user@ws.apache.org
Subject: Timeout too short, but which one?

Hi all,
I have just developed "my first webservice" containing two methods.
The first method does a search in a Lucene index and works OK.
The second method builds the Lucene index and does not work OK.

Some context: I use Axis 1.4 and Tomcat 5.5.25 both on Sun Java 1.5.0_13.
(Yes, I am a conservative :-)

I have found the following:
"Does not work OK" has as a symptom that there is no return SOAP-message
(TCPIP-monitor in Eclipse), the index gets built.
A difference between the two methods is that the indexing takes longer to
complete, in the order of fifteen seconds. Before I started the same
process from a JSP and encountered no problems.
I replaced the indexing with a sleep() call of the same duration and the
problem persisted, so the indexing is not at fault.
Another difference is in the parameters, doSearch uses XML documents for
request and response, createIndex Strings. I think this is not relevant.
I kicked the logging up to the debug level and upto the second
AxisServlet.doPost timing log (after the construction of the SOAPPart)
everything seems to be identical for both methods.

I tried letting my method sleep() with incrementing duration from 1 second
with steps of 1 second. 10 seconds returned, 11 did not.

Now my question: What timeout can I set where to allow for the method to
complete? (the client waits long enough anyway:-)

Thanx,
René Mondeel


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org