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

修改webservice 默认超时时间

发布时间:2020-12-16 23:50:50 所属栏目:安全 来源:网络整理
导读:http://stackoverflow.com/questions/3130913/setting-jax-ws-client-timeout sun自带的webservice 超时通过? With Metro/Glassfish... //1 minute for connection (( BindingProvider ) wsPort ). getRequestContext (). put ( "com.sun.xml.ws.connect.tim

http://stackoverflow.com/questions/3130913/setting-jax-ws-client-timeout

sun自带的webservice 超时通过?

With Metro/Glassfish...

//1 minute for connection ((BindingProvider) wsPort).getRequestContext().put("com.sun.xml.ws.connect.timeout", 1 * 60 * 1000); //3 minutos for request (("com.sun.xml.ws.request.timeout",0)">3 * 1000); 

Best regards!

share | improve this answer
?
1 ?
Actually that is what said in 1st answer (and in the question itself) Also maybe it makes sense to?import com.sun.xml.ws.developer.JAXWSProperties?and useJAXWSProperties.CONNECT_TIMEOUT?and?JAXWSProperties.REQUEST_TIMEOUT?if someone is not afraid to couple with Sun internals.?–?? dma_k? Sep 29 '10 at 8:03
?
How do I get wsPort instance??–?? mvmn? Feb 7 '12 at 22:06
Doesn't seem to work at all.?–?? Arne Evertsson? Nov 13 '12 at 15:27
Eww,string keys. Just what I should never have to see in a type-safe language. Whoever designed this API should burn in a fire.?–?? Trejkaz? Feb 4 at 2:17
add comment
up vote 1 down vote
ProxyWs proxy = (ProxyWs) factory.create(); Client client = ClientProxy.getClient(proxy); HTTPConduit http = (HTTPConduit) client.getConduit(); HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); httpClientPolicy.setConnectionTimeout(0); httpClientPolicy.setReceiveTimeout(0); http.setClient(httpClientPolicy);

This worked for me.

| improve this answer
? add comment
down vote

If you are using a Sun JRE,you can set the following system properties for default network connect and read timeouts (in milliseconds). I haven't tried these with the JAX-WS client,but they ought work there as well:

sun.net.client.defaultConnectTimeout sun.net.client.defaultReadTimeout

(编辑:李大同)

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

    推荐文章
      热点阅读