In our application, I am using webservice client generated from a wsdl provided by other web service application vendor. Sometimes calls to the webservice keeps on waiting for connection, may be due to network problem or webservice is down. Can anybody tell me how to set time out value so that it can close the connection if it could not get in certain time. Is this possible at the client side code or do we need modify wsdl in order to set this or is there any other way to achieve this?
I'm using JAX-RPC with websphere v6.1. I've tried too many configurations and code snippets to set the TimeOut value.
1) (Stub) myStub.setTimeOut(20*000)
2)Configuring the ibm-webservicesclinet-bnd.xmi deployment descriptor
But nothing seems to work.
With the timeout set to 20 seconds,when the webservice provider is unavailable, application takes over 5 mins to come back with a General Exception, but since our Total transaction TimeOut (in the WAS console) is only 120 secs, the applications sees a Timeout exception and Rollback is performed. The Network team analyzed the issue and said our Client is creating multiple request to the provider which could be the reason why it takes more than the TimeOut value to return.