Installing Apache SOAP

By following the instructions below, you can have Apache SOAP running with Tomcat on a Windows platform very quickly. If you vary these instructions in any way, e.g. by installing to different directories, you must consistently apply the variation. Once Apache SOAP is installed, you can do basic Apache SOAP coding, run Visual Basic clients or access EJBs with SOAP using Apache SOAP And JBoss.

JDK
Tomcat
Apache SOAP Server
Apache SOAP Client
Resources

JDK

  1. Download a version of J2SE from Sun. I used version 1.2.2 for these tests.
  2. Follow the instructions in the installer. I installed to j:\jdk1.2.2.
Return to top.

Tomcat

  1. Download a version of Tomcat from the Apache Jakarta Project. I used version 4.0.1 for these tests. You must use 4.0 or later to follow these instructions.
  2. Unzip the downloaded file. I unzipped to j:\, which put everything in the j:\jakarta-tomcat-4.0.1 directory.
  3. Start Tomcat by running
    • j:
    • cd \jakarta-tomcat-4.0.1\bin
    • startup
  4. Test that Tomcat is running by pointing your browser to http://localhost:8080/index.html. You should get a page saying "If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!."
Return to top.

Apache SOAP Server

  1. Download a version of Apache SOAP from the Apache XML pages. I downloaded the version 2.2 binary for these tests. You must use 2.2 or later to follow these instructions.
  2. Unzip the downloaded file. I unzipped to j:\, which put everything in the j:\soap-2_2 directory.
  3. Install Apache SOAP as a Tomcat Web application by running
    • j:
    • cd \jakarta-tomcat-4.0.1\bin
    • shutdown
    • cd \jakarta-tomcat-4.0.1\webapps
    • mkdir soap
    • cd soap
    • jar -xvf j:\soap-2_2\webapps\soap.war
    • cd \jakarta-tomcat-4.0.1\bin
    • startup
  4. Test that Apache SOAP is installed by pointing your browser to http://localhost:8080/soap/index.html. You should get a page saying "Hello! Welcome to Apache-SOAP."
  5. Further test that Apache SOAP is installed by pointing your browser to http://localhost:8080/soap/servlet/rpcrouter. You should get a page saying "Sorry, I don't speak via HTTP GET- you have to use HTTP POST to talk to me."
Return to top.

Apache SOAP Client

  1. For the Apache SOAP client to work, Xerces, Apache SOAP, JavaMail and the Java Activation Framework should be in the CLASSPATH. It so happens that Tomcat includes usable versions of Xerces, JavaMail and Java Activation Framework. I set my CLASSPATH to the following.

    .;j:\jakarta-tomcat-4.0.1\common\lib\xerces.jar;j:\soap-2_2\lib\soap.jar;j:\soap-2_2;   j:\jakarta-tomcat-4.0.1\common\lib\mail.jar;j:\jakarta-tomcat-4.0.1\common\lib\activation.jar

  2. Run the address book sample tests by doing the following
    • j:
    • cd \soap-2_2\samples\addressbook
    • testit
    If this works, you will get the following output:
    This test assumes a server URL of http://localhost:8080/soap/servlet/rpcrouter
    Deploying the addressbook service...
    .
    Verify that it's there
    Deployed Services:
            urn:AddressFetcher
    .
    Getting info for "Mr Good"
    
    123 Main Street
    Anytown, NY 12345
    (123) 456-7890
    .
    Adding "John Doe"
    John Doe has been added.
    .
    Query "Mr Doe" to make sure it was added
    
    123 Main Street
    AnyTown, SS 12345
    (800) 555-1212
    .
    Adding an XML file of listings
    Added 2 listings.
    .
    Get everyone!
    <AddressBook>
      <Listing>
        <Name>John B. Good</Name>
        <Address>
          <StreetNum>123</StreetNum>
          <StreetName>Main Street</StreetName>
          <City>Anytown</City>
          <State>NY</State>
          <Zip>12345</Zip>
          <PhoneNumber>
            <AreaCode>123</AreaCode>
            <Exchange>456</Exchange>
            <Number>7890</Number>
          </PhoneNumber>
        </Address>
      </Listing>
      <Listing>
        <Name>Dave Davis</Name>
        <Address>
          <StreetNum>919</StreetNum>
          <StreetName>Baker Lane</StreetName>
          <City>Sunnytown</City>
          <State>UT</State>
          <Zip>43434</Zip>
          <PhoneNumber>
            <AreaCode>789</AreaCode>
            <Exchange>654</Exchange>
            <Number>3210</Number>
          </PhoneNumber>
        </Address>
      </Listing>
      <Listing>
        <Name>John Doe</Name>
        <Address>
          <StreetNum>123</StreetNum>
          <StreetName>Main Street</StreetName>
          <City>AnyTown</City>
          <State>SS</State>
          <Zip>12345</Zip>
          <PhoneNumber>
            <AreaCode>800</AreaCode>
            <Exchange>555</Exchange>
            <Number>1212</Number>
          </PhoneNumber>
        </Address>
      </Listing>
      <Listing>
        <Name>Bob Q. Public</Name>
        <Address>
          <StreetNum>456</StreetNum>
          <StreetName>North Whatever</StreetName>
          <City>Notown</City>
          <State>ME</State>
          <Zip>12424</Zip>
          <PhoneNumber>
            <AreaCode>987</AreaCode>
            <Exchange>444</Exchange>
            <Number>5566</Number>
          </PhoneNumber>
        </Address>
      </Listing>
      <Listing>
        <Name>Mary Smith</Name>
        <Address>
          <StreetNum>888</StreetNum>
          <StreetName>Broadway</StreetName>
          <City>Somewhere</City>
          <State>FL</State>
          <Zip>87654</Zip>
          <PhoneNumber>
            <AreaCode>222</AreaCode>
            <Exchange>333</Exchange>
            <Number>4444</Number>
          </PhoneNumber>
        </Address>
      </Listing>
    </AddressBook>
    .
    Undeploy it now
    .
    Verify that it's gone
    Deployed Services:
    	
  3. Deploy the address book and stock quote samples by running the following
    • j:
    • cd \soap-2_2\samples\addressbook
    • java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy DeploymentDescriptor.xml
    • cd \soap-2_2\samples\stockquote
    • java org.apache.soap.server.ServiceManagerClient http://localhost:8080/soap/servlet/rpcrouter deploy DeploymentDescriptor.xml
Return to top.

Resources

Using SOAP with Tomcat, which also covers writing Apache SOAP code.
Server-Side SOAP, if you want to use Tomcat 3.x.
Clean up your wire protocol with SOAP, Part 2, which also covers writing Apache SOAP code.

Return to top.

Copyright © 2002 Scott Nichol.
02-Apr-2002