Hi,

I'm trying to set a global timeout with HTTPClient using the
CommonsHTTPSender class. I do this with this code :

AxisProperties.setProperty(DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY,
timeout);
AxisProperties.setProperty(DefaultCommonsHTTPClientProperties.CONNECTION_DEFAULT_SO_TIMEOUT_KEY,
timeout);

However this timeout is not used in Axis, because the
MessageContext class has now a default timeout
(Constants.DEFAULT_MESSAGE_TIMEOUT) and the method
addContextInfo() overwrites httpclient settings :

if (msgContext.getTimeout() != 0) {
/* ISSUE: these are not the same, but MessageContext has only
one definition of timeout */
// SO_TIMEOUT -- timeout for blocking reads
httpClient.getHttpConnectionManager().getParams().setSoTimeout(msgContext.getTimeout());
// timeout for initial connection
httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(msgContext.getTimeout());
}

Because msgContext.getTimeout() =
Constants.DEFAULT_MESSAGE_TIMEOUT = 60 * 1000 * 10, the
httpclient timeout is not used.


To correct this I changed the addContextInfo code to :

"if (msgContext.getTimeout()
!=Constants.DEFAULT_MESSAGE_TIMEOUT)",

which is good only if the user don't want to actually use
Constants.DEFAULT_MESSAGE_TIMEOUT after having set a default
timeout in httpclient...

Is there another way to do it ? Am I missing something or is
it a bug ?

Regards,

Rémi Flament.

Accédez au courrier électronique de La Poste : www.laposte.net ; 
3615 LAPOSTENET (0,34 €/mn) ; tél : 08 92 68 13 50 (0,34€/mn)




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to