On Tue, 2007-05-08 at 13:52 +0200, Jens Goerke wrote: 
> Hi!
> 
> When calling HttpClient via Axis the previously set HttpParams 
> (http.connection.timeout and http.socket.timeout) get replaced by some 
> arbitrary defaults (600000 ms) I've yet to find anywhere.
> 
> Axis uses HttpClient(this.connectionManager), so it's the 
> HttpClient(HttpConnectionManager httpConnectionManager) case, which contains 
> the line "private HttpClientParams = null".
> 
> Since I'm more familiar with more traditional programming languages I'm 
> trying to figure out where those timeout parameters are set to 10 minutes and 
> how to set the defaults to values actually suited for this task.
> 
> In axis-1_4/src/org/apache/axis/transport/http/CommonsHTTPSender.java the 
> parameters are set correctly by "initialize":
> [07.05.07 15:36:09.202] (DEBUG) [DefaultHttpParams]: Set parameter 
> http.connection.timeout = 20001
> [07.05.07 15:36:09.203] (DEBUG) [DefaultHttpParams]: Set parameter 
> http.socket.timeout = 20003
> 
> ...but get overwritten during "invoke":
> [07.05.07 15:36:09.454] (DEBUG) [DefaultHttpParams]: Set parameter 
> http.socket.timeout = 600000
> [07.05.07 15:36:09.455] (DEBUG) [DefaultHttpParams]: Set parameter 
> http.connection.timeout = 600000
> 
> I've tried setting them within "invoke", but to no avail, so I looked deeper 
> into "HttpClient.java" and was stumped by "private HttpClientParams = null".
> 
> Can anybody point me in the right direction?
> 
> Thanks in advance,
> Jens Goerke

Jens,

HttpParams associated with HttpClient are expected to be initialized by
the constructor. Hence null assignment in the instance variable
declaration. 

As far as I know  CommonsHTTPSender reads the default parameter values
from a configuration file

=====================
        // Get the timeout values from the configuration
        try {
            Parameter tempSoTimeoutParam = transportOut
                    .getParameter(HTTPConstants.SO_TIMEOUT);
            Parameter tempConnTimeoutParam = transportOut
                    .getParameter(HTTPConstants.CONNECTION_TIMEOUT);

            if (tempSoTimeoutParam != null) {
                soTimeout = Integer.parseInt((String) tempSoTimeoutParam
                        .getValue());
            }

            if (tempConnTimeoutParam != null) {
                connectionTimeout = Integer
                        .parseInt((String)
tempConnTimeoutParam.getValue());
            }
        } catch (NumberFormatException nfe) {

            // If there's a problem log it and use the default values
            log.error("Invalid timeout value format: not a number",
nfe);
        }
=====================

The easiest solution to this problem would be to use the Axis2 config
file to initialize the HTTP sender

Hope this helps

Oleg


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

Reply via email to