8

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?

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Jonas Andersson
  • 8,678
  • 2
  • 19
  • 14

1 Answers1

9

Try with this code in Jboss:

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

Have a look to this thread.

systempuntoout
  • 71,966
  • 47
  • 171
  • 241
  • 2
    That solves it! StubExt is in: import org.jboss.ws.core.StubExt; Had to add some maven dependencies: jboss-eap jbossws-spi 4.3.0.GA_CP02 provided jboss-eap jbossws-core 4.3.0.GA_CP02 provided Thanks a lot! – Jonas Andersson Apr 07 '10 at 13:24