我正在尝试为使用jaxws-maven-plugin生成的jax-ws-webservice-client设置请求(和连接)超时时间。在tomcat或jetty下运行应用程序时,超时时间有效,但在jboss下部署时不起作用。
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);
}
这个在JBoss中的正确做法是什么?