Apache Axis2 User's Guide - Installing and Testing Client Code

The best way to make sure that your system is running Axis2 is to install and test both a service and a client. The process involves the following steps:

Content

The Short Story:

  1. Install Axis2 into a suitable container such as Apache Tomcat by copying the axis2.war file to the webapps directory.
  2. Install the service into the Axis2 application by copying the *.aar file into the Axis2 services directory.
  3. Install the client on the system on which you want to run it and make sure all of the Axis2 libraries are on the CLASSPATH.
  4. Run the client

The Long Story:

Start by installing a suitable container, such as Apache Tomcat. Any J2EE server will do. To install Axis2 on the server, download the Axis2 War distribution from http://ws.apache.org/axis2/download.cgi and place the axis2.war file in the server's webapps directory. The server will then expand the distribution into its proper structure, seen in the earlier section.

Axis2 services come bundled as *.aar files, which contain all of the pieces necessary to define the service, such as the necessary classes and libraries and the services.xml file that defines the service's behavior. You can install the service using the Web administration application, but to make things simple for now, copy the *.aar file into the Axis2 services directory. For example, to install the MyService service distributed as one of the Axis2 samples, copy the file <AXIS2_HOME>/samples/userguide/build/MyService.aar file which is built using the ant command from <AXIS2_HOME>/samples/userguide, to the directory <J2EE_HOME>/webapps/axis2/WEB-INF/services.

Your client can come in any number of forms, from a collection of files to a single *.jar file. The important thing is to ensure that all the appropriate classes are on the classpath. In addition to the classes that pertain to the actual client, you must also add the Axis2 jar files into the CLASSPATH. Normally you will do this by downloading and unpacking the Axis2 Standard Distribution and adding the *.jar files in the lib directory to your CLASSPATH, but you also have the option to run your client using the axis2.bat (or axis2.sh) script, which takes care of it for you. For example, you can run a client with the command: axis2 org.apache.axis2.axis2userguide.Client.

See Next Section- Introduction to Services