简体   繁体   English

Web服务超时Java Web服务

[英]Webservice timeout java web service

I have a webservice stub. 我有一个Web服务存根。 I am setting the timeout for the stub like this. 我正在像这样设置存根的超时时间。 stub. 存根。 getServiceClient().getOptions().setTimeOutInMilliSeconds(timeout * 1 * 1000); getServiceClient()。getOptions()。setTimeOutInMilliSeconds(timeout * 1 * 1000);

But this doesnt work (ie the connection is alive even after the timeout period). 但这是行不通的(即,即使在超时时间之后,连接仍然有效)。 Can you please tell me why is it so? 你能告诉我为什么吗? Thanks in advance. 提前致谢。 :) :)

We implement the timeout for our webservice clients as follows 我们为Web服务客户端实施超时,如下所示

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, 获取选项对象,设置值,然后将选项对象重新设置在存根上,

我很确定这是进入WS的请求的超时时间...即30秒钟后放弃(如果您无法返回)。

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

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