Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set the jax-ws client request timeout programatically on jboss?

I am trying to set the request (and connection) timeout for a jax-ws-webservice-client generated with the jaxws-maven-plugin. When running my app under tomcat or jetty the timeout works, but when deployed under jboss it doesn't "take".

private void setRequestAndConnectionTimeout(Object wsPort) {
  String REQUEST_TIMEOUT = BindingProviderProperties.REQUEST_TIMEOUT; // "com.sun.xml.ws.request.timeout";
  ((BindingProvider) wsPort).getRequestContext().put(REQUEST_TIMEOUT, timeoutInMillisecs);
  ((BindingProvider) wsPort).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeoutInMillisecs);
}

What is the correct way to do this for JBoss?

like image 836
Jonas Andersson Avatar asked Apr 07 '10 12:04

Jonas Andersson


1 Answers

Try with this code in Jboss:

(BindingProvider)wsPort).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, yourTimeoutInMillisec);

Have a look to this thread.

like image 186
systempuntoout Avatar answered Oct 24 '22 01:10

systempuntoout