Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-2985

Updates to http-transport.html

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3
    • documentation
    • None

    Description

      Hi,

      As far as I could find, the following page documents the http
      transport in axis2/java:

      http://ws.apache.org/axis2/1_2/http-transport.html

      In my opinion, there are a lot of missing information in this page.
      Please find suggestions of additions in the following of this message.

      [ https ]

      Documentation says:

      ---------8<---------------8<---------------8<---------------8<------
      Please note that HTTPS works only when the server does not expect to
      authenticate the clients and where the server has the clients' public
      keys in its trust store.
      ---------8<---------------8<---------------8<---------------8<------

      This is not correct, I'm using SSL client authentication with axis2
      You can change the documentation to:

      ---------8<---------------8<---------------8<---------------8<------
      Please note that by default HTTPS works only when the server does not
      expect to authenticate the clients (1-way SSL only) and where the
      server has the clients' public keys in its trust store.

      If you want to perform SSL client authentication (2-way SSL), you may
      use the Protocol.registerProtocol feature of HttpClient. You can
      overwrite the "https" protocol, or use a different protocol for your
      SSL client authentication communications if you don't want to mess
      with regular https. Find more information at
      http://jakarta.apache.org/commons/httpclient/sslguide.html
      ---------8<---------------8<---------------8<---------------8<------

      [ chunking ]

      It's sometimes more convenient to disable the chunking
      programmatically rather that in the XML configuration. For example,
      before the text "Some absolute properties are provided at runtime",
      you could add:

      ---------8<---------------8<---------------8<---------------8<------
      If you use HTTP1.1 for its Keep-Alive ability, but you need to disable
      chunking at runtime (some servers don't allow chunked requests to
      prevent denial of service), you can do so in the Stub:

      <pre>
      options.setProperty(HTTPConstants.CHUNKED, "false");
      </pre>
      ---------8<---------------8<---------------8<---------------8<------

      [ reusing httpclient ]

      It can dramatically improve performance, I think it should be
      documented. Proposal:

      ---------8<---------------8<---------------8<---------------8<------
      Reusing the httpclient object

      By default, a new httpclient object is created for each send. It may
      be worthwhile to reuse the same httpclient object to take advantage of
      HTTP1.1 Keep-Alive, especially in HTTPS environment, where the SSL
      handshake may not be of negligible cost. To reuse the same httpclient
      object, you can set the relevant property in the Stub:

      <pre>
      options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, "true");
      </pre>
      ---------8<---------------8<---------------8<---------------8<------

      [ setting the cached httpclient ]

      The default max connections per host of httpclient is 2. For a reused
      httpclient, that may be too small; for raising that figure, you need
      to set the cached httpclient object which is not documented AFAIK.
      Proposal:

      ---------8<---------------8<---------------8<---------------8<------
      Setting the cached httpclient object

      To control the max connections per host attempted in parallel by a
      reused httpclient (this can be worthwhile as the default value is 2
      connections per host), or any other advanced parameters, you need to
      set the cached httpclient object when your application starts up
      (before any actual axis request). You can set the relevant property in
      the Stub:

      <pre>
      MultiThreadedHttpConnectionManager conmgr = new
      MultiThreadedHttpConnectionManager();
      conmgr.getParams().setDefaultMaxConnectionsPerHost(10);
      HttpClient client = new HttpClient(conmgr);
      configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, client);
      </pre>
      ---------8<---------------8<---------------8<---------------8<------

      Hope you can make use of these additions.


      Guillaume Cottenceau - http://zarb.org/~gc/

      Attachments

        Activity

          People

            saminda Saminda Wishwajith Abeyruwan
            dims Davanum Srinivas
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: