网络服务超时java网络服务 [英] Webservice timeout java web service
本文介绍了网络服务超时java网络服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网络服务存根.我正在为这样的存根设置超时.stub.getServiceClient().getOptions().setTimeOutInMilliSeconds(timeout * 1 * 1000);
I have a webservice stub. I am setting the timeout for the stub like this. stub.getServiceClient().getOptions().setTimeOutInMilliSeconds(timeout * 1 * 1000);
但这不起作用(即即使在超时期限之后连接仍然有效).你能告诉我为什么会这样吗?提前致谢.:)
But this doesnt work (i.e. the connection is alive even after the timeout period). Can you please tell me why is it so? Thanks in advance. :)
推荐答案
我们为我们的 webservice 客户端实现超时
We implement the timeout for our webservice clients as follows
org.apache.axis2.client.Options options = stub._getServiceClient().getOptions();
options.setTimeOutInMilliSeconds(timeoutMillisLimit + 2500);
stub._getServiceClient().setOptions(options);
获取选项对象,设置值,然后将选项对象设置回存根,
Get the Options object, set the values, then set the Options object back on the stub,
这篇关于网络服务超时java网络服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文