mujeeb
mujeeb

Reputation: 819

Webservice timeout java web service

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

Upvotes: 0

Views: 4919

Answers (2)

Kevin D
Kevin D

Reputation: 3594

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,

Upvotes: 2

Aaron McIver
Aaron McIver

Reputation: 24713

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.

Upvotes: 0

Related Questions