Deploying and Running the Example in TomCat

In this section, we show you how to deploy the example in a TomCat servlet container. We still assume that you have installed the IBM WSTK, but instead of Embedded WebSphere you want to deploy it in TomCat. If you have not installed the IBM WSTK on your machine, but you have TomCat and Apache SOAP, click here to learn how you can install the example.

  1. Copy soap.war from D:\wstk-2.4\soap\webapps to the webapps sub-directory of your TomCat installation directory.

  2. TomCat has a batch file that it uses to set the environment variables. This batch file is called tomcat.bat. In this batch file, TomCat includes some jar files that must not be used in SOAP. So we have to change tomcat.bat to make it more compliant to Apache SOAP. Please click here to see a typical modified version of tomcat.bat that can be used to deploy this example on TomCat.

  3. Open a DOS session and go to the WSTK bin directory. Enter the command

    wstkenv
  4. Update the CLASSPATH by entering the command

    set CLASSPATH=%CLASSPATH%;%WSTK_CP%;D:\Pure\excelwbservice.jar;D:\jintegra\lib\jintegra.jar;D:\Pure\excel.jar;
  5. Update the PATH by entering the command

    set PATH=%PATH%;D:\jintegra\bin;
  6. Go to the TomCat bin directory and start the TomCat server by entering the command

    startup

    Note Before executing the startup command you should modify the tomcat.bat as mentioned here, otherwise your deployment will fail.

  7. Open another DOS session and go to D:\Pure. Update the CLASSPATH by entering the command

    set CLASSPATH=%CLASSPATH%;%WSTK_CP%;D:\Pure\excelwbservice.jar;D:\jintegra\lib\jintegra.jar;D:\Pure\excel.jar;
  8. Update the PATH by entering the command

    set PATH=%PATH%;D:\jintegra\bin;
  9. While you are in D:\Pure, enter this command to deploy the example onto the Tomcat servlet container

    java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy DeploymentDescriptor.xml

    Note If you are running the TomCat server on a different host or port, replace localhost and/or 8080 with the appropriate values.

  10. If there was no error on running the command, the Excel Calculator Web Service is deployed and ready to use.

  11. Follow the instructions in Running the Calculator Web Service Client to run the example.