Apache Axis and Axis2 Support and Configuration

Here are the instructions for configuration of both Apache Axis and Axis2 with the HTTP client.


Apache Axis2

Only Axis2 version 1.2 or higher is supported. Our integration has been tested with Axis2 versions 1.2 through 1.5.

To use the Oakland Software HTTP Client with Axis2, set the HTTP transport class to: com.oaklandsw.http.axis2.OaklandHTTPTransportSender2. The instructions for setting the classname in the XML configuration file are the same as the instructions for the Apache HTTP Client, with the exception of the class name. The Oakland Software transport module uses the following transport configuration properties:

  • PROTOCOL - used to specify HTTP or HTTPS (for secure). The version is ignored and 1.1 is assumed.
  • Transfer-Encoding - as described in the Apache documentation.
  • PROXY - as described in the Apache documentation.
  • CONNECTION_TIMEOUT - same as HttpURLConnection.set[Default]ConnectionTimeout()
  • SO_TIMEOUT - same as HttpURLConnection.set[Default]RequestTimeout()

Authentication (Specifying User/Password/Domain)

Important: if you are using NTLM authentication, then set the default authentication type to NTLM using HttpURLConnection.setDefaultAuthenticationType(Credential.AUTH_NTLM). This makes sure NTLM authentication will be processed even if you are using Chunked Transfer-Encoding.

You can use the normal method Axis2 method of specifying the HTTP authentication credentials (user/password/domain). This works with basic, digest or NTLM authentication. The user/password/domain will be automatically obtained from Axis2. The specification of the authentication scheme (basic, digest, NTLM) is not required, as the credentials specified will be provided in response to a request for them (a 401/407 status). If an authentication scheme is specified, only one is allowed as the Oakland Software transport does not support the priority selection of authentication schemes as supported by the Apache Commons HTTP Client (let us know if you require this). In contrast to Axis 1.x, the domain name is not specified with the user name.


Apache Axis (not Axis2)

To use the Oakland Software HTTP Client with Axis, set the HTTP transport class to: com.oaklandsw.http.axis.OaklandHTTPSender. The instructions for setting the classname in the XML configuration file are the same as the instructions for the Apache HTTP Client, with the exception of the class name. The Oakland Software transport module uses the same configuration objects as used by the Apache HTTP Client:

  • MAXIMUM_TOTAL_CONNECTIONS_PROPERTY_KEY - not supported.
  • MAXIMUM_CONNECTIONS_PER_HOST_PROPERTY_KEY - same as HttpURLConnection.setMaxConnectionsPerHost()
  • CONNECTION_POOL_TIMEOUT_KEY - same as HttpURLConnection.set[Default]ConnectionTimeout()
  • CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY - same as HttpURLConnection.set[Default]ConnectionTimeout()
  • CONNECTION_DEFAULT_SO_TIMEOUT_KEY - same as HttpURLConnection.set[Default]RequestTimeout()

Authentication (Specifying User/Password/Domain)

You can use the normal method Axis method of specifying the HTTP authentication credentials (user/password). This works with basic, digest or NTLM authentication. The user/password (which are set using Call.setUser/Password()) will be automatically obtained from Axis. If you are using NTLM authentation, the user must be in the form "domain\user" (be sure and specify 2 back-slashes if using a Java quoted string) where domain is the Windows domain name.


Native Authentication (both Axis and Axis2)

You may choose to use the normal Oakland Software HTTP client mechanism to specific both proxy and regular authentication credentials using a com.oaklandsw.http.HttpUserAgent class. Do this by calling HttpURLConnection.setDefaultUserAgent(). If the default user agent is set in this manner, it will be used for authentation. If it is not set, authentation will use the Axis/Axis2 credentials described above.

NOTE: The Oakland Software HTTP client gets the proxy credentials from "http.proxyUser" and "http.proxyPassword" at the time the first HttpURLConnection is created. This is true even if the protocol being used is HTTPS, which is a different behaviour than the normal JRE HTTP client, and Axis. If you wish to reset the proxy credentials, either use the HttpUserAgent as described below, or call HttpURLConnection.setProxyUser/Password().


Proxy Authentication (both Axis and Axis2)

Authentication credentials for a proxy connection may be provided using the normal "http.proxyUser" and "http.proxyPassword", as is normally done with Axis 1.x (and the JRE HTTP Client implementation). If you use a proxy that requires NTLM authentation, then you must specified the "domain\user" as mentioned above.