http://kingsfleet.blogspot.com/2007/11/changing-endpoint-location-for-jax-ws.html
For more information on the MessageContext properties (the exact list I was looking for):
https://jax-ws.dev.java.net/articles/MessageContext.html
As well, a common problem that I have is setting timeouts for the Web Service calls. While this should be the first result of a Google "JAX-WS timeout" search, I always end up having to run around in circles finding the answer. And, of course, every major server has their own way of doing this. However, in this case (Glassfish v2, JAX-WS 2.1) the answer is as follows:
((BindingProvider)port).getRequestContext().put(
"com.sun.xml.ws.connect.timeout", connectionTimeout);
((BindingProvider)port).getRequestContext().put(
"com.sun.xml.ws.request.timeout", socketTimeout);
"com.sun.xml.ws.connect.timeout", connectionTimeout);
((BindingProvider)port).getRequestContext().put(
"com.sun.xml.ws.request.timeout", socketTimeout);
Now, why these are not constants in BindingProvider...
2 comments:
And, like magic, the first response returned by a Google search for "jax-ws timeout" is now https://jax-ws.dev.java.net/guide/HTTP_Timeouts.html
I guess they're updating their documentation based on my blog :P
Note: this is in Metro, JAX-WS 2.1
Are you sure that these properties names are correct?
Shouldn't they be
com.sun.xml.internal.ws.connect.timeout and com.sun.xml.internal.ws.request.timeout as defined in class com.sun.xml.internal.ws.developer.JAXWSProperties?
Post a Comment