Webservice timeout java web service
I have a webservice stub. I am setting the timeout for the stub like this. stub.getServiceClie开发者_开发技巧nt().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. :)
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,
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.
精彩评论