I saw there were some discussion about SocketTimeout exception.
I would like to know what is causing this, i.e. the server side or the client side.
Because when I look at the code snippet suggested by Jonathan Lowe,


MyServiceLocator serviceLocator = new MyServiceLocator();
MyPort port = serviceLocator.getPort(url);
org.apache.axis.client.Stub stub = (org.apache.axis.client.Stub ) port;
stub.setTimeout(<milli seconds>);

I am in the impression that there is some default timeout value set in the client side.

But when I made the call  in  my client side,
int timeout = stub.getTimeout();
The timeout value I got was '0'.

What does the timeout value 0 mean? Does it mean the client never times out the socket?

In Tomcat's server.xml under the conf directory, there is an attribute
connectionTimeout="20000" in the Connector element.
This is 20 seconds since the unit is in milliseconds.
How does this affect the timeout in the client side?

The problem I have is that my SOAP service connects to back end DB
and the response could take some time.  This causes the client to get
SocketTimeout (read timeout).  Should I change the timeout value in
the client side, or can I just change the connectionTimeout in
Tomcat?







Reply via email to