Howto: Usage of AXIS in JOnAS

This guide describes basic Axis use within JOnAS. It assumes that the reader does not require any explanation about Axis-specific tasks (e.g., axis deployment with WSDD). Before deployment in Axis, the user must verify that the deploy.wsdd file matches the site 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 (Session Bean) is packaged in a separate ejb-jar (or even EAR). The intent of this approach is to make EJBs from differents packages that are already deployed accessible as Web Services via a single Axis Webapp deployment. The drawback is that Web Services are centralized in one Webapp only and the only way to distinguish between them for access is by the <service-name>, not by the <context-root>/<service-name>. In addition, the ejb-jar files that contain the Web Services must be included in the Webapp.
  2. The accessed EJB(s) are packaged with the Axis Webapp in an EAR archive. With this approach, the ejb-jar files do not have to be included in the Webapp WEB-INF/lib directory; different Applications that contain Web Services can be hosted, providing the capability of distinguishing between Web Services of different applications.

Libraries

JOnAS incorporates all the 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: Refer to the separate_axis example (in the $JONAS_ROOT/examples directory).
 

2. Embedded Axis Webapp

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

3. Tests

When everything is deployed and running, use the following URL to view the deployed Web Services:
http://<yourserver>:<port>/<yourwebapp>/servlet/AxisServlet
This page will display a link for each Web Service with the 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>

A client class can now be run against the Web Service. Note that any language (with Web Services capabilities) can be used for the client (C#, Java, etc.).

Tools:

Use jclient to deploy your Web Services (in the Axis way):
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)