wood burning stoves 2.0*
The moose likes Web Services and the fly likes How to specify WebService operation timeout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to specify WebService operation timeout " Watch "How to specify WebService operation timeout " New topic
Author

How to specify WebService operation timeout

Rohit Macherla
Greenhorn

Joined: Mar 02, 2009
Posts: 3
Hi,

I am working with JAX-WS webservices. We host some webservices on the JBoss 4.2.2 Application server. Since these webservices are hosted by me, I need to set the maximum amount of time that the webservice should be allowed to process. In case the processing takes up a lot of time, i need to rollback it. Can this be achieved by JAX-WS ? All that I find by googling it points me to a nice "executionTimeout" but that's in the .NET webservices.
If there is no such parameter, what is the default time that a calling webservice is allowed to wait (regardless of the timeout of that client) ?
Thanks for the time.


Cheers,
Rohit M.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Rohit Macherla wrote:In case the processing takes up a lot of time, i need to rollback it.

Maybe you are trying to impose the timeout in the wrong place. For Example:
java.sql.Statement.setQueryTimeout(int)

All that I find by googling it points me to a nice "executionTimeout" but that's in the .NET webservices.

The HttpRuntimeSection.ExecutionTimeout Property seems to be a feature of the hosting ASP.NET platform (inherited from the ASP platform†) - not the web services framework.

(† Script/Request Timeout for JSP/Servlet?)

"Don't succumb to the false authority of a tool or model. There is no substitute for thinking."
Andy Hunt, Pragmatic Thinking & Learning: Refactor Your Wetware p.41
Rohit Macherla
Greenhorn

Joined: Mar 02, 2009
Posts: 3
Hi Peer Reynders,

Thanks for the reply.
Just a couple of questions :
So, does this mean that if my webservice goes into an infinite loop, or takes about 10hours to process, and , say the client that is invoking my webservice sets a timeout of 11hours, then everything would go fine ?(Supposing that all the other work that is done in the webservice doesn't timeout before that) I mean, I was thinking that there should be some configuration somewhere that should stop this. Please let me know if I am wrong.

Thanks.
arulk pillai
Author
Ranch Hand

Joined: May 31, 2007
Posts: 3216
I haven't used JBoss, but this will be a configuration in the JBoss Web Container thread pool. I have used this in Websphere. The default timeout is 60 seconds in Websphere. JBoss uses Tomcat. So, check the server.xml file.


Java Interview Questions and Answers Blog | Amazon.com profile | Java Interview Books
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2906
Rohit Macherla wrote:So, does this mean that if my webservice goes into an infinite loop, or takes about 10hours to process, and , say the client that is invoking my webservice sets a timeout of 11hours, then everything would go fine ?

It is unrealistic that a client would stick around that long (because of client-side timeouts) and the server side resources would still be tied up.

Tomcat doesn't seem to have a request, servlet or "whatever you want to call it" timeout that limits the execution time for servlets.

So the possibility of an indefinitely hung servlet seems to be very real. This is illustrated by a comment made in the mod_jk Apache Tomcat connector documentation.
The Apache Tomcat Connector - Timeouts HowTo Reply Timeout
If JK aborts waiting for a response, because a reply timeout fired, there is no way to stop processing on the backend. Although you free processing resources in your web server, the request will continue to run on the backend - without any way to send back a result once the reply timeout fired.


(Jetty at least gives you a maxIdleTime configuration parameter).
Rohit Macherla
Greenhorn

Joined: Mar 02, 2009
Posts: 3
Hi Peer Reynders,

Thanks a lot for your reply and your time.
We will rely on the client side timeout itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to specify WebService operation timeout
 
Similar Threads
InputStream as a responce in JAX-WS webservice
How to deploy a JAX-WS webservice which is both Service Provider and Consumer for someother Service?
Do I need a App Server to run JAX-WS
Why JAX-WS over JAX-RPC + JAXB
String SOAP xml to java object