My Notepad

  • My Linux Notes
  • My Grid Notes
  • To do List
  • Friday, March 20, 2009

     

    Axis 1.4 client timeout

    There are essentially two kinds of timeout: One is socket timeout, the other is connection time.
    The former is the timeout blocking reads. It's the timeout when data is blocked but after a socket is initialized; the latter if the timeout when initilze a socket. E.g. if due to firewall, axis client can't reach a server, the socket will not be initialized. In this case, only the connection timeout will take effect.

    Depends on whether you are using stub in axis client or not, you can either use call org.apache.axis.client.Call.setTimeout() or org.apache.axis.client.Stub.setTimeout() to set the timeout value, e.g. 3000 miliseconds. Both of them are doing same thing - add timeout value into the org.apache.axis.MessageContext.

    The timeout value in MessaageContext works fine when you try to connect to HTTP service, in which case org.apache.axis.components.net.DefaultSocketFactory is used. This class does implement support to both socket timeout and connection timeout, it will set both of them to the timeout it reads from MessageContext.

    But when trying to connect to a HTTPS service, org.apache.axis.components.net.JSSESocketFactory is used. This is a buggy class doesn't support connection timeout. It will read timeout value from MessageContext but only consider it as socket timeout. The default connection timeout is 10 min.

    The solution to this problem is to use CommonsHTTPSender.This is based on Jakarta Commons' Implementation of HttpClient and has good support to both kinds of timeout. It will read timeout value from MessageContext and use it for both socket timeout and connection timeout.

    To change to use CommonsHTTPSender, edit your client-config.wsdd, and change
    pivot="java:org.apache.axis.transport.http.HTTPSender"

    to,

    pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"


    For more information regarding this issue, see:
    http://www.mail-archive.com/axis-user@xml.apache.org/msg18632.html
    http://markmail.org/message/hq4wbc75slxsyp5v?q=JSSESocketFactory+timeout



    Comments: Post a Comment



    << Home

    Archives

    December 2005   January 2006   February 2006   April 2006   May 2006   June 2006   July 2006   November 2006   February 2007   May 2007   June 2007   November 2007   February 2008   March 2008   April 2008   August 2008   December 2008   March 2009   April 2009   May 2009   June 2009   October 2009   November 2009   December 2009   May 2013  

    This page is powered by Blogger. Isn't yours?