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

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


The Short Story:

  1. Install Apache Axis2 in 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 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 Apache Axis2 on the server, download the Axis2 WAR distribution and place the axis2.war file in the server's webapps directory. The server will then expand the distribution into its proper structure, as seen in the earlier section.

Apache Axis2 services come bundled as *.aar files, which contain all 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, or you also have the option of running 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