加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

How do I set the timeout for a JAX-WS webservice client? if

发布时间:2020-12-17 00:29:34 所属栏目:安全 来源:网络整理
导读:1. 参考:http://stackoverflow.com/questions/2148915/how-do-i-set-the-timeout-for-a-jax-ws-webservice-client ?if you want to set timeouts for specific services,once you've created your proxy you need to cast it to a BindingProvider (which y

1. 参考:http://stackoverflow.com/questions/2148915/how-do-i-set-the-timeout-for-a-jax-ws-webservice-client

?if you want to set timeouts for specific services,once you've created your proxy you need to cast it to a BindingProvider (which you know already),get the request context and set your properties. The online JAX-WS documentation is wrong,these are the correct property names

MyInterface myInterface = new MyInterfaceService().getMyInterfaceSOAP();
Map<String,Object> requestContext = ((BindingProvider)myInterface).getRequestContext();
requestContext.put(BindingProviderProperties.REQUEST_TIMEOUT,3000); // Timeout in millis
requestContext.put(BindingProviderProperties.CONNECT_TIMEOUT,1000); // Timeout in millis
myInterface.callMyRemoteMethodWith(myParameter);
2.? http://www.voidcn.com/article/p-qfoxhxqo-xw.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读