There are essentially two kinds of timeout: One is socket timeout, the other is connection time.
The former is the timeout blocking reads. It's the timeout when data is blocked but after a socket is initialized; the latter if the timeout when initilze a socket. E.g. if due to firewall, axis client can't reach a server, the socket will not be initialized. In this case, only the connection timeout will take effect.
Depends on whether you are using stub in axis client or not, you can either use call org.apache.axis.client.Call.setTimeout() or org.apache.axis.client.Stub.setTimeout() to set the timeout value, e.g. 3000 miliseconds. Both of them are doing same thing - add timeout value into the org.apache.axis.MessageContext.
The timeout value in MessaageContext works fine when you try to connect to HTTP service, in which case
org.apache.axis.components.net.DefaultSocketFactory is used. This class does implement support to both socket timeout and connection timeout, it will set both of them to the timeout it reads from MessageContext.
But when trying to connect to a HTTPS service, org.apache.axis.components.net.JSSESocketFactory is used. This is a buggy class doesn't support connection timeout. It will read timeout value from MessageContext but only consider it as socket timeout. The default connection timeout is 10 min.
The solution to this problem is to use
CommonsHTTPSender.This is based on Jakarta Commons' Implementation of HttpClient and has good support to both kinds of timeout. It will read timeout value from MessageContext and use it for both socket timeout and connection timeout.
To change to use CommonsHTTPSender, edit your client-config.wsdd, and change
pivot="java:org.apache.axis.transport.http.HTTPSender"
to,
pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"
For more information regarding this issue, see:
http://www.mail-archive.com/axis-user@xml.apache.org/msg18632.html
http://markmail.org/message/hq4wbc75slxsyp5v?q=JSSESocketFactory+timeout