You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Wouter Cloetens <wc...@raleigh.ibm.com> on 2000/09/08 05:20:31 UTC

RE: Client timeout

+1
I just implemented the feature a couple of days ago in my JMS transport. It's 
quite crucial for async message queueing transport types, where you don't 
even know if the server's running. At least with HTTP you know that the 
webserver's up if you managed to connect and send your data.

The tricky thing is, how do you report that exception to the client? You could 
just throw a SOAPException, but  I'd like the client to be able to discriminate 
between other protocol errors and the timeout. The client may want to do a 
retry later, try a backup service,... The failure may not be fatal to the program 
like other protocol errors can be. Call.java's invoke() will break if the 
transport type returns a null response.
Also, I'd like to be able to distinguish between a connect timeout to the 
remote service and a timeout on receiving the response. I'll wait maybe 30 
seconds for an HTTP connect, but once I send my payload, I'll happily wait 
5 minutes for the response if I'm submitting an order for $50M in 
thermonuclear warheads.
How about a subclass of SOAPException? E.g. 
SOAPConnectTimeoutException/SOAPSendTimeoutException and 
SOAPReceiveTimeoutException.

bfn, Wouter

On Fri, 8 Sep 2000 08:33:08 -0400, Kevin Mitchell wrote:

>No, you are not missing anything.  There is currently no way to set a
>timeout on the socket established
>from the client to the SOAP server. The quick solution is to modify
>org.apache.soap.util.net.HTTPUtils's post method to set a timeout on the
>Socket using setSoTimeout.  I actually worked in a more configurable
>mechanism for setting a timeout (i.e. thru APIs) in the IBM-SOAP
>distribution, and am currently working on moving it over to Apache-SOAP. 
>
>Does the audience think such a feature (setting a timeout on client socket)
>will be useful for the general community? If so, I should be able to commit
>the changes within the next couple of days... 
>
>~kjm
>
>-----Original Message-----
>From: Keith Thomas [mailto:K@XOL.com]
>Sent: Thursday, September 07, 2000 4:29 PM
>To: 'soap-user@xml.apache.org'
>Subject: Client timeout
>
>
>Hi,
>
>Please accept my apologies if this question has been asked before. I am
>trying to test various failure scenarios and have come across something 
that
>I want to double check. When my server just hangs then my client hangs as
>well. I cannot see anyway within xml-soap itself of setting a timeout value.
>Am I missing something ?
>
>Regards,
>Keith Thomas
>Xtra On-Line

--
http://www.workspot.net/~zombie/soap/
My opinions are irrelevant. They will be assimilated by my employer.