Apache-SOAP Version 2.3: Installing the Server Side Under Apache Tomcat v5.0

NOTE: These instructions apply to Tomcat 5.0. There are separate instructions for Tomcat 4.0 and 4.1, Tomcat 3.1, Tomcat 3.3 and Tomcat 3.2.

Getting Tomcat ready:

IMPORTANT: With Tomcat 5.0, you do not need to change the startup scripts. You need to place the jars for JavaMail and Java Activation Framework in a directory where a Tomcat class loader can find them. You need to place Apache SOAP files within Tomcat's webapps directory.

Copy the jars for JavaMail (mail.jar) and Java Activation Framework (activation.jar) into %CATALINA_HOME%/shared/lib.

Deploying Apache-SOAP on Tomcat:

There are two different ways to actually deploy Apache SOAP on Tomcat:

Method 1: Deploying the web archive.

The Apache SOAP distribution includes a web archive at /soap-2_3/webapps/soap.war. Simply drop this web archive into Tomcat's webapps directory (i.e. %catalina_home%/webapps). Note: If you copy the web archive into the webapps directory while Tomcat is running, Tomcat will need to be restarted before the Apache SOAP web application can be accessed.

Keep in mind that if you want to replace the deployed Apache SOAP web application with a later version that you will probably have to shut the server down, remove the expanded %catalina_home%/webapps/soap directory, and replace the %catalina_home%/webapps/soap.war file with the newer one.

Method 2: Creating a new <Context> in Tomcat's server.xml file.

There are two ways to approach this. First, you can add a new <Context> element for the WAR file into %catalina_home%/conf/server.xml:

<Context path="/soap" docBase="path-to-apache-soap/webapps/soap.war" debug="1" reloadable="true" />

With this approach, you must put the classes or jars for your services in %CATALINA_HOME%/shared/classes or %CATALINA_HOME%/shared/lib, respectively. This is less than desirable.

For the second approach, you first unjar the WAR file into the path-to-apache-soap/webapps/soap directory. Then you can add a new <Context> element into %catalina_home%/conf/server.xml:

<Context path="/soap" docBase="path-to-apache-soap/webapps/soap" debug="1" reloadable="true" />

With this method, you can either put your service classes and jars in %CATALINA_HOME%/shared/classes or %CATALINA_HOME%/shared/lib (undesirable), or under path-to-apache-soap/webapps/soap/WEB-INF (much better).

If your service classes depend on classes from Apache SOAP, they cannot be put in %CATALINA_HOME%/shared/classes or %CATALINA_HOME%/shared/lib, as the Apache SOAP classes are not visible to them there.

Accessing the Apache SOAP context:

You should be able to deploy services by pointing a browser to

http://hostname:port/soap

where hostname is the host on which Tomcat is running and port is the port. See the User's Guide for details on the administration tool. The SOAP end-point for invoking services on this server is:

http://hostname:port/soap/servlet/rpcrouter

Happy SOAP-ing!