Skip to main content

Can I Include a response timeout into a webservice atomic transaction ?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
OAliouch
Offline
Joined: 2011-06-06

Hi,

I have a servlet that call a transactional webservice and need to get a response quickly, so I use : ((BindingProvider)wsPort).getRequestContext().put("com.sun.xml.ws.connect.timeout", 5000); to specify that if the webservice take more than 5 seconde to responde we just throw a timeout exception, and in the catch clause I rollback the transaction. (wsPort is the interface client of my webservice)

So what I want is to rollback all the transactions that have been made by my webservice if I get a timeout exception, but when I specify that my webservice is a transactional one I just get an exception that says something like a "The transaction have been cut off" (I can provide a more detailed error log if you ask me) and he commit in the Data base

Is there another way to specify a request timeout with the WS-AT? or am I doing something wrong?

Any help or idea will be welcome!

regards

Oualid

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sauvage
Offline
Joined: 2004-03-04

Hi,

You are not using the right timeout setting, you are defining the connect timeout, ie the max time to establish the TCP connection. If you want to set the read timeout use com.sun.xml.ws.request.timeout setting instead. cf http://metro.java.net/guide/HTTP_Timeouts.html.

Regards,

Laurent.

PS: Oualid si tu ne sais pas, demande-moi plutôt que de poster sur les forums, comme ca je peux meme te répondre en francais ;-)