Following is a set of instruction for installing Apache Axis, registering a simple Calculator Web service, creating a WSDL description for the service, and developing a simple client that calls on the Calculator service.
- Installing Apache Axis on CDF
- Download the file axis-1_3.tar and untar is in $CATALINA_HOME/webapps. You should see a directory called axis.
- Installing Apache Axis somewhere else
- Download the file axis-1_3.tar and untar is in $CATALINA_HOME/webapps. You should see a directory called axis.
- Download the file lib-1_3.tar, untar it, and copy its contents to $CATALINA_HOME/common/lib.
- Validate the Apache Axis installation
- Start Tomcat
- Point your browser to http://localhost:yourport/axis. You should see the Apache Axis welcome page. If this is not the case, make sure that Tomcat is in fact running and that you have added the axis directory under $CATALINA_HOME/webapps.
- Click on Validation. Axis will then search for a set of needed and optional components. If any of the needed components is not found, make sure that the needed jar file is located at $CATALINA_HOME/common/lib.
- Install the Calculator Web service
- Download the files Calculator.java and deploy.wsdd
- Compile Calculator.java
- Move the file Calculator.class to $CATALINA_HOME/webapps/axis/WEB-INF/classes
- Add the various Apache Axis jar files to your CLASSPATH environment variable. On CDF you can do this by adding the following commands to your .cshrc file:
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/axis.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/saaj.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/commons-discovery-0.2.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/commons-logging-1.0.4.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/jaxrpc.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/log4j-1.2.8.jar
setenv CLASSPATH {$CLASSPATH}:/u/csc309h/lib/tomcat-5.0.28/common/lib/wsdl4j-1.5.1.jar
- Deploy the Calculator service by calling:
java org.apache.axis.client.AdminClient -pyourport deploy.wsdd
Note: The above call requires Tomcat to be running.
- Verify that the Calculator Web service has been successfully deployed by pointing your browser to http://localhost:yourport/axis/services/Calculator?wsdl. You should see the WSDL description of the Calculator service.
- Create a WSDL description for the Calculator Web service
- cd to $CATALINA_HOME/webapps/axis/WEB-INF/classes
- Call the Java2WSDL translator as follows (change the port to your assigned value):
java org.apache.axis.wsdl.Java2WSDL -o calculator.wsdl -l "http://localhost:yourport/axis/services/Calculator" -n "urn:Calculator" Calculator
- The above call will create the file calculator.wsdl in the current directory.
- Create a simple client.