问题
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