How to use AXIS in JOnAS

The aim of this document is to show basics for Axis usage within JOnAS. It assumes that the reader does not need explanation about Axis particular tasks (axis deployment with WSDD, ...). Before deployment in Axis, the reader has to check the deploy.wsdd file in order to ensure that the file matches her machine configuration (jndiURL parameter in particular :<parameter name="jndiURL" value="rmi://localhost:1099"/>).

This document describes two ways to make an EJB (stateless SB) available as a Web Service with JOnAS:

  1. Axis runs in a unique Webapp, the stateless SB is packaged in a separate ejb-jar (or even EAR). The interest of this approach is to make EJBs from differents packages already deployed accessible as Web Services by using a single Axis Webapp deployed hereafter. The drawback is that Web Services are centralized in one Webapp only and then when you want to access theses Web Services, you can distinct them only on the <service-name>, not on the couple <context-root>/<service-name>, and you must include in the Webapp the ejb-jar files which are containing Web Services.
  2. The accessed EJB(s) are packaged with the Axis Webapp in an EAR archive. With this approach, you do not have to include the ejb-jar files in the Webapp WEB-INF/lib directory, you can host different Applications which are containing Web Services, and distinction between Web Services of different applications can be done.

Libraries

JOnAS incorporates all necessary libraries including : (JAX-M and JAX-R are parts of the Web Services Development Pack from Sun)

1. Unique Axis Webapp

Constraints : Usage :


Example : see the separate_axis example (in the $JONAS_ROOT/examples directory).
 

2. Embedded Axis Webapp

Constraints : Usage : Example : see the embedded_axis example (in the $JONAS_ROOT/examples directory).
 

3. Tests

Now all the stuff is deployed and running.
You can view the deployed Web Services at this URL :
http://<yourserver>:<port>/<yourwebapp>/servlet/AxisServlet
In this page, you'll see for each Web Service, a link with his WSDL file (automatically generated by Axis from the Java Interfaces).
Use the following URL to access your Web Service (add ?WSDL for the associated WSDL file)
http://<yourserver>:<port>/<yourwebapp>/services/<Service-Name>

If you have a client class to run against the Web Service, it's time to use it! You should know that any language (with Web Services capabilities) can be used for your client (C#, Java, ...).

Tools :

In order to deploy your Web Services (in the Axis way) you must use jclient :
jclient org.apache.axis.client.AdminClient [OPTIONS] <WSDD-file>
[OPTIONS] :
  -l<URL> : the location of the AxisServlet servlet (default : http://localhost:8080/axis/servlet/AxisServlet)
  -p<port>: the port of the listening http daemon (default : 8080)
  -h<host>: the hostname of the server running the JOnAS server (default : localhost)