Apache-SOAP Version 2.3: Installing the Server Side Under Apache Tomcat v3.2

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

Getting Tomcat ready:

IMPORTANT: Tomcat comes with an XML parser (lib/xml.jar) which has the DOM level 1 interfaces. Even if you put Xerces 1.1.2's xerces.jar in your classpath, the wrong interfaces are found by any Java code running in Tomcat because the shell script / batch file that runs Tomcat puts the user's classpath at the end. So, you must edit tomcat.sh or tomcat.bat in the bin/ directory and put xerces.jar at the BEGINNING of the classpath the script builds.

If you run startup.bat, then line 105 (or there abouts) of tomcat.bat should look like this (line 69 for Tomcat 3.2.1) :

set CP=path-to-xerces\xerces.jar;%CLASSPATH%;%CP%

If you run startup.sh, add the following line to tomcat.sh after line 113 (or there abouts), so long as it's before the export line:

CLASSPATH=path-to-xerces/xerces.jar:${CLASSPATH}

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. %tomcat_home%/webapps). If you deploy Apache SOAP into Tomcat in this manner, you will not need to have anything from the /soap-2_3 directory on your server's classpath (the relevant items are included in the web archive). 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 %tomcat_home%/webapps/soap directory, and replace the %tomcat_home%/webapps/soap.war file with the newer one.

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

Simply add a new <Context> element into %tomcat_home%/conf/server.xml:

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

Now, make sure you have the jar files from the lib directory of this distribution on your classpath and start up tomcat. Also, you will want to have on the classpath any of your code that you want to deploy as services (e.g. /soap-2_3 if you want to deploy any of the included samples).

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!