简体   繁体   English

Java Web Service客户端超时值未更改

[英]Java Web Service Client Timeout values not changing

is there a reason when I set the time out for a service call from the client that it doesnt override the defualt values? 当我为来自客户端的服务呼叫设置超时时,是否有理由不覆盖默认值?

I have tried all these but no luck. 我尝试了所有这些,但是没有运气。

DictionaryTransferService service = new DictionaryTransferService();

DictionaryTransfer port = service.getDictionaryTransferPort();

((BindingProvider) port).getRequestContext().put(StubExt.PROPERTY_CLIENT_TIMEOUT, 10 * 60 * 1000);
((BindingProvider) port).getRequestContext().put("com.sun.xml.internal.ws.connect.timeout", 5 * 60 * 1000);
((BindingProvider) port).getRequestContext().put("com.sun.xml.internal.ws.request.timeout", 10 * 60 * 1000);
((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpointURL.toString());

The constants for these JAX-WS RI settings changed at one point, so it may be that you need to use these instead: 这些JAX-WS RI设置的常数在一处发生了变化,因此可能是您需要使用这些常数:

"com.sun.xml.ws.connect.timeout"
"com.sun.xml.ws.request.timeout"

Or better yet, use the constants from the JAXWSProperties class itself. 或者更好的是,使用JAXWSProperties类本身的常量。

You might also try these since you're running JBoss: 您还可以尝试以下方法,因为您正在运行JBoss:

org.jboss.ws.core.StubExt.PROPERTY_CONNECTION_TIMEOUT
org.jboss.ws.core.StubExt.PROPERTY_RECEIVE_TIMEOUT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM