开发者

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

开发者 https://www.devze.com 2022-12-25 18:11 出处:网络
I am trying to set the request开发者_JAVA技巧 (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

I am trying to set the request开发者_JAVA技巧 (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?


Try with this code in Jboss:

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

Have a look to this thread.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号