SOAPConnection: how to set a client-side timeout?
843833Dec 19 2006 — edited Dec 20 2006When we use SOAPConnection to send a message to remote server, and the server just hangs (no reply at all), how can we cancel the waiting after a specified amount of time (let's say 30 seconds)?
Currently, the call() waits indefinitely long (1 hour at least).
P.S. the overall code with some omissions:
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory
.newInstance();
SOAPConnection connection = soapConnectionFactory
.createConnection();
URL endpoint = new URL(serverURL);
response = connection.call(message, endpoint);