Webservice timeout java web service

泪湿孤枕 提交于 2020-01-07 04:45:45

问题


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. :)


回答1:


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,




回答2:


I'm pretty sure this is the timeout period for a request coming into the WS...ie after 30 seconds give up if you can't return.



来源:https://stackoverflow.com/questions/3916996/webservice-timeout-java-web-service

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!