Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SOAPConnection: how to set a client-side timeout?

843833Dec 19 2006 — edited Dec 20 2006
When 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);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 17 2007
Added on Dec 19 2006
1 comment
2,077 views