views:

30

answers:

2

Hi Guys,

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

A: 

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.

Aaron
+1  A: 

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,

Kevin D