Q: How do I configure the Axis client to pool connections with Apache Jakarta Commons-HttpClient?
A: You'll need to install commons-httpclient in your CLASSPATH or WEB-INF/lib, if your client is deployed as a web application. Note that if you are building Axis from source, you will also need to put commons-httpclient in Axis dependencies directory so that the <noWiki>CommonsHTTPSender</noWiki> class is built.
Next, you'll need to install a client-config.wsdd that tells Axis to use <noWiki>CommonsHTTPSender</noWiki> instead of the standard HTTPSender when sending/receiving messages via HTTP. Here's an example:
<?xml version="1.0" encoding="UTF-8"?>
<deployment name="commonsHTTPConfig" xmlns="<noWiki>http://xml.apache.org/axis/wsdd/</noWiki>" xmlns:java="<noWiki>http://xml.apache.org/axis/wsdd/providers/java</noWiki>"> {{{ <transport name="http" pivot="<noWiki>java:org.apache.axis.transport.http.CommonsHTTPSender</noWiki>" />
<transport name="local" pivot = "<noWiki>java:org.apache.axis.transport.local.LocalSender</noWiki>" /> <transport name="java" pivot="<noWiki>java:org.apache.axis.transport.java.JavaSender</noWiki>" /> }}}
</deployment>
Finally, you will almost certainly want to adjust the default settings for the connection pool (pool size, timeout, and so forth). Those are defined in the <noWiki>org.apache.axis.components.net.CommonsHTTPClientProperties</noWiki> interface and can be set using the AxisProperties API that is used by all of the pluggable components in Axis. You can also provide your own implementation of the interface if you need to do some special adjustments to those settings. For that you would use the commons-discovery API. (Note this requires Axis 1.2)