Skip to main content

How to implement JAX-WS client timeout?

3 replies [Last post]
joshuad
Offline
Joined: 2008-01-22
Points: 0

How do I implement a timeout for a JAX-WS Web Service call on GlassFish v2? Is there a system property for setting the socket/connection timeouts, or a JAX-WS specific setting?

Thanks,

Josh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ragnorok
Offline
Joined: 2008-04-28
Points: 0

... the latest available for download as of last week. Any other hints would be greatly appreciated...

joshuad
Offline
Joined: 2008-01-22
Points: 0

Answer:

((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.connect.timeout", connectionTimeout);
((BindingProvider)port).getRequestContext().put("com.sun.xml.ws.request.timeout", socketTimeout);

Apparently the JAXWSProperties is supposed to contain these flags, but I couldn't find it anywhere. As well, this may only work in JAX-WS 2.1...

ragnorok
Offline
Joined: 2008-04-28
Points: 0

- This doesn't work with Java 5 using JWSDP 2.0. I tried putting in JAX-WS 2.1.1 but it gets an error that the AccessType Annotation is missing, where that doesn't happen wwith JWSDP 2.0. Is there an issue with 2.0 that keeps this from working?
- Thanks!...