【发布时间】:2014-06-18 18:13:08
【问题描述】:
我有一个 JAX-WS Web 服务客户端。我尝试像这样设置超时属性:
Map<String, Object> requestContext = bp.getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT, 20);
//I also tried using
//"javax.xml.ws.client.receiveTimeout" in the place of REQUEST_TIMEOUT
//It behaved the same way.
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT, 10000);
更多详情请看问题How do I set the timeout for a JAX-WS webservice client?
但是,我没有看到超时发生。它应该给出一个读取超时,因为我们触发的服务没有在 20 毫秒内提供响应。我们还尝试使 REQUEST_TIMEOUT 值为负,但它给出了相同的响应。由此我确认请求上下文中设置的值没有指定服务超时。
有谁知道为什么这个设置不起作用以及我应该怎么做?
【问题讨论】:
标签: java web-services