Axis: Difference between revisions

From Wiki RB4
Line 18: Line 18:
# add folder META-INF to service group directory
# add folder META-INF to service group directory
# add service.xml to META-INF folder
# add service.xml to META-INF folder
# build stub by ???


==Axis1==
==Axis1==

Revision as of 23:18, 2 February 2012

Axis2

Installation

  • extract axis2-1.6.1-bin.zip to C:\Uwes\java\axis2-1.6.1
  • set AXIS2_HOME to C:\Uwes\java\axis2-1.6.1

Introduction

If something does not work have a look at the examples in the installation directory.

Operation

There are two ways to create a web services, either starting by with a wsdl or ???. For creating a wsdl from an existing java class there is a tool Java2WSDL. Then there is a tool WSDL2java which generates the skeleton (server side) and stub (client side).

Create a web service for an existing POJO and web application

  1. add axis2 servlet to web.xml
  2. add folders conf, modules and services to WEB-INF directory
  3. for each service group add folder to directory services
  4. add folder META-INF to service group directory
  5. add service.xml to META-INF folder
  6. build stub by ???

Axis1

Basics

Apache Axis is an Open Source SOAP server and client. But Axis isn't just a SOAP engine -- it also includes:

  • a simple stand-alone server,
  • a server which plugs into servlet engines such as Tomcat,
  • extensive support for the Web Service Description Language (WSDL),
  • emitter tooling that generates Java classes from WSDL.
  • some sample programs, and
  • a tool for monitoring TCP/IP packets.

Axis handles the magic of converting Java objects to SOAP data when it sends it over the wire or receives results. SOAP Faults are sent by the server when something goes wrong; Axis converts these to Java exceptions. Axis is written as a J2EE 1.2 compliant web application, and can be installed on any J2EE compliant servlet (Tomcat 3.2+, Websphere 4+, Weblogic 6+).

Adding a WebService to a WebApp

  1. Add axis.jar, wsdl.jar, saaj.jar, jaxrpc.jar and the other dependent libraries to your WAR file.
  2. Copy all the Axis Servlet declarations and mappings from axis/WEB-INF/web.xml and add them to your own web.xml
  3. Build and deploy your webapp.
  4. deploy the webservice e.g. by ant with an axis-admin task (s. project 'uweheuer', build.xml, target deploy_laptop_webservices)

Sources