aspose file tools*
The moose likes Web Services and the fly likes JAX-WS RI 2.1 where do I put timeout code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-WS RI 2.1 where do I put timeout code?" Watch "JAX-WS RI 2.1 where do I put timeout code?" New topic
Author

JAX-WS RI 2.1 where do I put timeout code?

John Landon
Ranch Hand

Joined: Sep 25, 2008
Posts: 227
Hi,
I have a web service implemented with JAX-WS RI 2.1.
The service is RMI.
So when a client invokes a remote method. I send him response. Where do I put code that happens after the response was sent? Is there a timeout. So if the client died in the mean time I just reverse everything back as if the invocation never happened.

Thanks.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
John Landon wrote:Hi,
I have a web service implemented with JAX-WS RI 2.1.
The service is RMI.


:?: What does the binary Remote Method Invocation (RMI) protocol have to do with SOAP-based JAX-WS?

Where do I put code that happens after the response was sent? Is there a timeout. So if the client died in the mean time I just reverse everything back as if the invocation never happened.


Given that it is the hosting web server that is handling the HTTP response, JAX-WS on the server may not even have any knowledge of the fact that the client never finished receiving the response. But what kind of processing do you need to do that you need to "roll back" in case the client dies? It may be worth considering splitting the call into to phases: (1) initiation of processing returning a correlation ID and (2) retrieval of result with the correlation ID. That way the client can store the correlation ID outside of its process space (for later) in case the result retrieval fails and the server doesn't have to do the processing again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAX-WS RI 2.1 where do I put timeout code?