Axis The New Incarnation of Apache SOAP
Axis The New Incarnation of Apache SOAP
Axis The New Incarnation of Apache SOAP
of Apache SOAP
A technical White Paper by TechMetrix Research
Audience: Project Managers, Technical architects, developers
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
2/47
A
AAb
bbs
sst
ttr
rra
aac
cct
tt
Apache Axis is a new implementation of the SOAP specification developed by the The
Apache Software Foundation, which is the successor to Apache SOAP. This new
implementation aims to offer enhanced performances, and greater modularity and
extensibility than its predecessor. What is more, Axis is now based on the JAXM (Java
API for XML Messaging) and JAX-RPC (Java API for XML RPC) specifications currently
being drawn up by Sun. With complete support for the WSDL 1.1 standard, Axis also
displays greater compatibility with the latest versions of the SOAP specification (partial
support for SOAP 1.2).
Apache Axis is both an environment for hosting Web services and a comprehensive
development toolkit for creating services and client access to external services. This
toolkit features advanced automatic code generation functionality based on the parsing of
WSDL descriptions of Web Services and automatic two-way mapping between Java
classes and WSDL descriptions.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
3/47
C
CCo
oon
nnt
tte
een
nnt
tts
ss
1 Background....................................................................................................... 4
2 Presentation of Apache Axis Beta 2................................................................... 7
2.1 NEW FEATURES AND IMPROVEMENTS WITH REGARD TO APACHE SOAP.................................. 7
2.2 ARCHITECTURE .................................................................................................. 8
2.2.1 Operation of engine for message exchange and handling ..................................... 10
2.3 SUPPORT FOR DIFFERENT TYPES OF SOAP EXCHANGES ................................................. 12
2.4 SOAP TYPES SUPPORTED AND JAVA EQUIVALENTS....................................................... 13
2.5 SUPPORT FOR OUT AND IN-OUT PARAMETERS............................................................ 14
2.6 SECURITY SUPPORT ........................................................................................... 16
2.7 SESSION MANAGEMENT....................................................................................... 17
2.8 AUTOMATIC CODE GENERATION ............................................................................. 18
2.9 ADMINISTRATION ............................................................................................. 18
2.10 MONITORING RPC EXCHANGES BETWEEN CLIENT AND SERVER......................................... 20
3 Installing Axis................................................................................................. 21
3.1 DEPLOYING AXIS IN THE APACHE TOMCAT 4 .X SERVER................................................. 22
3.2 CONFIGURING THE DEVELOPMENT ENVIRONMENT ........................................................ 22
4 Development with Axis ................................................................................... 23
4.1 JWS: DRAG & DROP DEVELOPMENT FOR WEB SERVICES................................................ 23
4.1.1 Developing a JWS service with Axis.................................................................. 23
4.1.2 Developing an Axis client for access to the Web service....................................... 24
4.2 WSDD FLEXIBLE DEVELOPMENT AND DEPLOYMENT MODEL.............................................. 27
4.2.2 Developing an RPC-based Java Web Service from a Java class.............................. 29
4.2.3 Developing a Web service from a Java interface ................................................. 41
4.3 EVALUATION ................................................................................................... 45
5 Conclusion....................................................................................................... 46
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
4/47
1
11 B
BBa
aac
cck
kkg
ggr
rr o
oou
uun
nnd
dd
IBM has played a significant role in emancipating Web Service technology on the Java
platform, and it became something of a pioneer when it created one of the very first
implementations of SOAP for Java, the SOAP4J framework. Initially available as a technology
preview on IBM's alphaWorks site, SOAP4J quickly aroused a lot of interest within the Java
developers' community.
IBM, banking on this community's ability to ensure the success and durability of the
framework, decided to donate SOAP4J to the open source world in the second half of 2000.
In fact, the future of IBM's framework was entrusted to The Apache Software Foundation
(renowned for having been behind some of the most prestigious open-source projects, such
as the eponymous Web Server and the Tomcat Java application server). IBM has not left
the limelight, however, and is continuing to contribute actively to the development of the
project.
IBM's commitment as a major player in the Open Source movement:
As well as SOAP4J, IBM also instigated two other complementary frameworks in the field of Web
Services: WSDL4J (Java framework for the manipulation of WSDL descriptions of Web Services)
and UDDI4J (Java framework for interaction with UDDI directories, co-developed with HP). As a
key player in the free software world, IBM is also behind a number of other projects, such as the
XML parser Xerces (formerly XML4J), the XSL transformer Xalan (formerly LotusXSL) and more
recently, the Eclipse platform (modular, extensible Java development environment).
Renamed Apache SOAP, IBM's framework underwent a number of upgrades and
adjustments and enjoyed widespread success so much so that IBM and other major
vendors such as Sun quickly adopted Apache SOAP to integrate it into their J2EE application
servers as a support structure for Web services.
Those interested in reading more about the SOAP protocol, the Apache SOAP
implementation and its integration with application servers, can consult previous issues of
our monthly newsletter TrendMarkers:
SOAP (Simple Object Access Protocol)
Features of Apache SOAP 2.2
iPlanet Application Server and Web Services
Apache SOAP version 2.2, the most popular version due to its relative stability and maturity,
came out in May 2001. In the space of a year, the framework underwent few adjustments,
and it was only in May 2002 that version 2.3 appeared. The very latest version of Apache
SOAP (2.3.1) was released extremely recently, in June 2002. This late update of the Apache
SOAP seems a little odd, given that the framework has apparently reached the end of its
lifetime.
In fact, for over a year, all efforts have been concentrated on the development of a
successor to Apache SOAP, based on an entirely new architecture. Apache SOAP's
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
5/47
replacement, named Axis, has been designed to overcome its predecessor's drawbacks in
terms of extensibility (due to an architecture that had become too complex, too rigid, and
too closely linked to the SOAP specification) and performance (hampered by the use of the
Document Object Model (DOM) for processing XML streams). Rather than continue
developing Apache SOAP in increasingly difficult conditions, the Apache Foundation opted to
wipe the slate clean, and set out to conquer Web Services with a whole new set of
foundations. And hence the Axis project was born. More modular, with better performances,
and easily extended and adapted to different specifications, Axis also offers enhanced
support for Web Service specifications such as SOAP and WSDL.
In parallel, Sun and the other players participating in the development of the Java platform
have been working to draw up a new family of specifications and APIs dedicated to the
infrastructure of XML exchanges. This new family, the Java XML Pack, includes the following
specifications:
JAXM (Java API for XML Messaging): A set of APIs for exchanging messages
formatted as XML documents. JAXM includes low-level functions for construction,
routing and delivery of XML documents via SOAP 1.1 with Attachments (NB: in the
JAXM latest version, 1.1, the implementation of the SOAP exchange protocol has
been transferred to a new independent API, called SAAJ SOAP with Attachments
API for Java).
JAX-RPC (Java API for XML-based RPC): A set of APIs and conventions for
implementing XML-based RPC exchanges. The implementation model for RPC
services used is copied from the RMI model, and uses server-side proxy classes
(skeletons) and client-side proxy classes (stubs) for sending and receiving calls. JAX-
RPC includes an extensible model for mapping data types along with
serialization/deserialization mechanisms between Java objects and XML-Schema data
types.
Also, JAX-RPC defines two-way mapping functions between Java (interface classes,
methods) and XML/WSDL descriptions of RPC service interfaces. As one of the aims
of the specification is to remain independent from any particular standard, JAX-RPC is
designed to adapt to different protocols (including SOAP) and different transport
protocols (including HTTP and SMTP). SOAP support within JAX-RPC, provided
through the JAXM functionalities, is now based on SAAJ.
In compliance with the objectives of the JAXM and JAX-RPC specifications, Axis is designed
to be extensible and independent with regard to particular transport or exchange protocols.
So, although it supports SOAP over HTTP, Axis will in the future support other protocols
such as the forthcoming XML Protocol (based on SOAP 1.2), and other transport such as
SMTP. For this reason, the name "Axis" (Apache eXtensible Interaction System) was chosen
over "Apache SOAP 3.0", which was felt to be too restrictive due to the mention of the word
SOAP.
Since last summer, several pre-versions of Axis have followed one after the other. After
three Alpha versions and two Beta versions, a third Beta version is under preparation. We
should also point out that a C++ version of Axis (on Windows and Linux platforms for the
moment) is also currently being prepared. The release of the first public "final" version of
Axis (which will feature the version number 3.0, to mark its succession from Apache SOAP
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
6/47
2.x), initially planned for the summer, has apparently been held up. However, Axis already
has sufficient assets and functionality for us to be able to devote this article to the Beta 2
version which has been available since the end of April.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
7/47
2
22 P
PPr
rr e
ees
sse
een
nnt
tt a
aat
tt i
ii o
oon
nn o
oof
ff A
AAp
ppa
aac
cch
hhe
ee A
AAx
xxi
ii s
ss B
BBe
eet
tt a
aa 2
22
Apache Axis is an open-source implementation on the Java platform
of the SOAP version 1.1 and SOAP Messages with Attachments
specifications and includes certain features of the new version of the
standard, SOAP 1.2. Axis is developed by the Apache Software
Foundation.
Apache Axis is both an environment for hosting Web Services and a complete toolkit for
creating services and for client access to external services. This toolkit features advanced
automatic code generation functionality based on parsing of WSDL descriptions of Web
Services, and automatic two-way mapping between Java classes and WSDL descriptions.
2.1 New features and improvements with regard to
Apache SOAP
Compared to Apache SOAP, Axis enjoys a great deal of improvements and new features:
Fully revised architecture: Axis is built on entirely new foundations, based on
concepts defined by the JAX-RPC specification. The architecture of Axis is modular
and extensible: extensions can be easily added (for specific processing of
messages, or to include new administration or management functions). Similarly,
at its core, Axis contains an architecture of interchangeable transport protocols
("pluggable transport architecture"), independent of any transport protocol in
particular. It is therefore possible to add on support for other transport protocols
such as SMTP, FTP and so on.
Enhanced performance: one of Axis' objectives is to offer improved
performances (in terms of response times, memory usage and scalability) in
comparison with Apache SOAP. In particular, where Apache SOAP used the DOM
(Document Object Model) to parse XML streams, Axis is now based on SAX
(Simple API for XML Parsing). This enables memory usage to be significantly
reduced, and cuts the time required to process XML streams.
WSDL 1.1 support and Java/WSDL mapping functionality: one of the
important new features of Axis is its WSDL support. Axis is able to automatically
generate WSDL descriptions of deployed services, on the fly. Moreover, Axis
implements the Java/WSDL mapping functionality of the JAX-RPC API, which
makes it possible to automatically generate a Java client from the WSDL
description of a service, or to generate a WSDL description for a Java interface or
class to be exposed as a Web service.
Enhanced datatype support: support for datatypes from the XML-Schema
(2001) standard in Apache Axis is now much more comprehensive. In particular,
Apache Axis now supports numbered types, as well as untyped values.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
8/47
New service deployment model: like Apache SOAP, Axis uses XML deployment
descriptors (WSDD Web Service Deployment Descriptor) for deploying services.
However, the new WSDD XML format is incompatible with the old format used by
Apache SOAP. Axis also supports a new "instant, on-the-fly" deployment mode for
Web services: it is now possible to expose a Java class as a Web service very
simply, by moving a Java source file to a particular directory and changing the
".java" extension to ".jws" (Java Web Service).
Support for sessions and security: Axis features user session support
mechanisms (via SOAP headers, independent from the transport protocol used).
Axis also integrates access authentication and authorization mechanisms which
can be interfaced with the security mechanisms defined by the J2EE Servlet API.
Greater SOAP support: Axis fully supports the SOAP 1.1 specification, and even
offers partial compatibility with SOAP 1.2. Another new feature that was not
offered by Apache SOAP is the support for the concept of actors (now called roles
in SOAP 1.2) and the "mustUnderstand" attribute in SOAP header blocks.
Conversely, Axis does not yet support the concept of SOAP intermediaries.
Improved interoperability with the other SOAP implementations on the
market. In particular, Axis is now able to process SOAP messages with untyped
parameters. This brings greater interoperability with other SOAP implementations
such as Microsoft's MS-SOAP, which use untyped parameters in SOAP message
exchanges.
2.2 Architecture
The AxisEngine is designed with a modular architecture composed of different
subsystems. This architecture comprises a hierarchy made up of two main layers. The
first fundamental layer is consists of the Message Flow subsystem which defines the
message circulation and processing logic within the engine. This first general layer is
backed up by various specialized subsystems that implement functions specific to the
transport, encoding and message model protocols for RPC exchanges, along with
administration functions.
Whether Axis is used as a server (for hosting Web services) or client (for accessing Web
services), the architecture stays the same: the Axis server and client use exactly the
same engine. What differentiates an Axis client from an Axis server is the fact that an
Axis server requires a particular execution environment.
The Axis server may be hosted in two types of environment:
Within a Web container such as that in Apache Tomcat or another J2EE application
server. The Axis distribution comprises a Web application which must be deployed
on the application server. This is the most appropriate solution, and complies
most closely with the relevant recommendations in the JAX-RPC specification.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
9/47
Alternatively, Axis includes a specific lightweight HTTP server ("Axis Simple
Server") for hosting the Axis server. However, this is not really a viable option,
except during development, as this lightweight server with its basic functionality is
not suitable for production purposes.
The diagram below gives an overview of the various components of the architecture. The
dotted lines show the different implementations available for a given subsystem.
Axis Engine subsystems
Message Flow (foundation layer)
Admin Service Provider Transport Encoding Message Model
EJ B
JWS
java:MSG
SOAP java:RPC
Axis runtime host environment:
- third-party Servlet container hosting the Axis Web application, or:
- Axis' own standalone HTTP server [SimpleAxisServer] instantiating an Axis Server
Local
HTTP WSDD
Axis Engine subsystems
Message Flow (foundation layer)
Admin Service Provider Transport Encoding Message Model
EJ B
JWS
java:MSG
SOAP java:RPC
Axis runtime host environment:
- third-party Servlet container hosting the Axis Web application, or:
- Axis' own standalone HTTP server [SimpleAxisServer] instantiating an Axis Server
Local
HTTP WSDD
Overview of subsystems of AxisEngine
The AxisEngine is responsible for orchestrating the different subsystems:
The Administration subsystem, which handles administration and configuration of
the server and various message handlers, which we shall cover in more detail in
the next section.
The Service subsystem which implements the RPC exchange protocols. For the
moment, Axis only supports the SOAP protocol. However, in line with JAX-RPC,
Axis is designed to be able to support several exchange protocols, such as the
forthcoming XML Protocol.
The Provider subsystem, which is used to link between the Axis server and the
external component methods which are to be exposed as Web Services.
Currently, Axis enables simple Java classes or stateless session beans to be
exposed as Web Services. By the time the first stable version of Axis is released,
support for other component models should be available, including support for
component types previously supported by Apache SOAP: scripting language
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
10/47
objects (via the Bean Scripting Framework), and COM objects from Microsoft
Windows.
The Transport subsystem, which receives and delivers the messages from the
Service subsystem. As in the JAX-RPC specification, Axis' internal architecture is
totally independent of the underlying transport used for exchanges: it is therefore
possible to use any type of transport, such as HTTP, SMTP, FTP, etc. However, at
present, only one transport implementation is available for Axis: the HTTP
protocol.
There is also another type of transport called Local, which is essentially for test
purposes and operates in a local loop on one machine, enabling messages to transit
between an Axis client and an Axis server deployed on the same machine. It is likely
that the SMTP protocol will be supported in the first official release of Axis, as is the
case for Apache SOAP.
The Encoding subsystem. This subsystem manages encoding/decoding and
serialization/deserialization between XML data types and Java types. Mapping
between Java types (classes or primitives) and XML datatypes relies on the type
mapping mechanisms defined by JAX-RPC. The encoding subsystem stores
matches between Java types and XML types for services deployed within a Type
Mapping Registry.
The Message Model subsystem defines the structure of the different elements of a
SOAP message (envelope, header, body) and also provides functionality for
building and parsing the different elements of these messages. Parsing of SOAP
messages is carried out according to the event-based SAX model which optimizes
processing speed and memory usage.
2.2.1 Operation of engine for message exchange and handling
In order to understand the internal operation of Axis, we must look at the concepts used
by the engine's key subsystem, the Message Flow Subsystem.
Axis is above all a message exchange and handling system, and the framework is based
on three key concepts: message, flow, and handling.
A message is essentially a set of information represented by an XML data structure (in
other words, a message is an XML stream). An RPC exchange is defined by the circulation
or flow of messages between a client and a server: a request message, and a response
message. The request and response messages circulate not only between the client and
the server, but also within the handling and sending/receiving subsystems of the client
and server.
In the Axis architecture, this circulation is essentially what underpins the operation of the
server and the message handling mechanisms: the internal architecture of the Axis
engine is modular and extensible, as it is based on a configurable message-handling
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
11/47
pipeline. The handling pipeline comprises a modulable number of stages which each
carry out a specific process on the messages that pass through them.
Although this general description gives an overview of the message-handling architecture
of Axis, in practice there are also more complex concepts and mechanisms, as illustrated
in the diagram below:
Transport
Sender
Axis Server Engine
Response
Message
Service Global Config.
Transport
request chain
Global
request chain
Service
request chain
Transport
response chain
Global
response chain
Service
response chain
Provider
(pivot handler)
Listener
Request
Message
Web Service:
(JWS File, J ava
class, EJ B, etc.)
Message
context
Transport
Sender
Axis Server Engine
Response
Message
Service Global Config.
Transport
request chain
Transport
request chain
Global
request chain
Global
request chain
Service
request chain
Service
request chain
Transport
response chain
Transport
response chain
Global
response chain
Global
response chain
Service
response chain
Service
response chain
Provider
(pivot handler)
Listener
Request
Message
Web Service:
(JWS File, J ava
class, EJ B, etc.)
Web Service:
(JWS File, J ava
class, EJ B, etc.)
Web Service:
(JWS File, J ava
class, EJ B, etc.)
Message
context
Message flow and handling within the Axis server engine
The request or response messages are encapsulated in a more general structure called
the Message Context: a message context may encompass both a request and a response
message, and it also contains a "properties bag". The properties contained in this "bag"
include information on the transport used (HTTP, SMTP, etc.), and on the messages
themselves (in particular, the values of headers specific to SOAP messages, especially for
authentication and session management mechanisms).
The processing operations on messages are encapsulated in Message Handlers. These
message handlers are then grouped into Handler Chains made up of one or more
handlers.
The message context objects pass successively through the message handlers of several
handler chains. In turn, each message handler invoked carries out a specific operation on
the message context object.
This model is remarkably similar to the filtering model of the Servlet 2.3 API (Servlet
Filters), and is likewise based on a design pattern called the responsibility chain
(Responsibility Chain Design Pattern): each element in the chain is responsible for a
particular process, and the processes and responsibilities are clearly shared between
each of the elements in the chain.
Axis' message handling system contains two separate message flow circuits: a request,
or message receiving circuit, and a response, or message sending circuit. Both circuits
have three specific Handler Chains:
A Transport Chain, containing handlers responsible for carrying out formatting
operations on the messages received or sent. As messages circulate in both
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
12/47
directions (request and response direction), the transport chain is split into two.
Depending on the direction of circulation, each message received or sent either
passes through the Request Transport Chain or the Response Transport Chain.
Each transport protocol configured in Axis (e.g. HTTP, SMTP, etc.) has its
corresponding transport chain. Several Transport Chains can therefore be created,
each handling messages transiting by the relevant transport protocol.
A Global Chain containing handlers responsible for carrying out generic
operations on messages being sent or received. Once again, this global handling
chain is split up into a Global Request Chain, and a Global Response Chain. All
the messages that transit within the Axis server pass via the Global Chain,
independent of the type of transport used in the service.
Lastly, it is possible to configure a specific handler chain called a Service Chain
for each Axis Web service. This chain is also split into two further chains for
sending and receiving messages: Service Request Chain and Service Response
Chain. Messages going to or coming from a particular service therefore pass via
the specific handler chain for this service.
Each message handler chain can comprise any number of message handlers. The handler
chains are configured in the configuration file of the AxisEngine. What is more, it is very
easy to develop one's own message handlers for specific processes, and to deploy them
in one or other of the AxisEngine handler chains.
After passing through all the handler chains, the request messages reaches the Provider.
This handler dispatches the request messages to the actual service component (Java
class, EJB, etc.), and receives and sends the response messages via the response chain.
In Axis terminology, these provider handlers are also given the particular appellation of
Pivot Handlers.
This server-side message flow schema is mirrored on the client side, if Axis is used as a
client for accessing Web services. Since the architecture is the same, the Axis client also
has three configurable handler chains (service, transport and global) which the request
and response messages travel through. The only differences concern the order of handler
chains (in reverse order to the server) and the Pivot Handler: on the client side, there is
no provider handler, as the service is not on the client but on a remote server. Client-
side request messages pass in turn through the Service, Global and Transport Chains, to
end up at a particular handler called the Sender. On the client side, the sender plays the
role of Pivot Handler: it sends requests messages to the server, receives response
messages and sends them via the client's response chains.
2.3 Support for different types of SOAP exchanges
The SOAP specification defines two main types of exchange for implementing Web
services: RPC-based exchanges and message-based exchanges. Apache Axis supports
both these types of exchanges, and allows message- or RPC-based services to be
created, as well as (client) access to both these types of service.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
13/47
RPC-based exchanges constitute the highest-level implementation of services, and also
the most familiar and easy to use. These services operate according to the synchronous
request/response mode, and use a predefined XML message format for input and output:
the SOAP envelope, made up of a SOAP header, a message body, and optional additional
non-standardized message elements. In these RPC exchanges, the definition of the
name, type and encoding of In and Out parameters in the SOAP message are
standardized. Access to these services is simplified (in terms of programming), as the
Axis framework automatically handles serialization and deserialization of parameters and
return values.
Message-based exchanges, meanwhile, constitute a lower-level exchange model (on
which the RPC exchange model is based), and offer complete flexibility in terms of the
structure and content of exchanged messages, but at the expense of programming
simplicity. Unlike the RPC-based exchange mode, the message-based mode does not
define any particular rule for exchanging messages. Although requests from a message-
based service must be presented as a SOAP envelope, the structure and content of the
SOAP message body are free. Also, message-based services do not necessarily operate in
request-response mode: the service may send no response, or may send a formatted
response message inside a SOAP envelope, or may send a response message with a
particular structure. Message-based exchanges therefore bring complete freedom but
entail more complex programming: extraction of request message information (and if
necessary within response messages) is entirely handled by the service (and if
necessary, the client).
2.4 SOAP types supported and J ava equivalents
Apache Axis supports all the datatypes defined in the SOAP specification: simple types
(scalar types) and complex types (data structures). As regards XML encoding of data,
Axis supports SOAP 1.1 encoding, SOAP 1.2 encoding, and XML-Schema encoding (1999,
2000, and 2001 versions).
The table below shows the equivalences between the Java types supported by Axis in
SOAP exchanges, and the corresponding simple types from the XML Schema
specification:
Primitive or Java class XML-Schema datatype
boolean, java.lang.Boolean xsd:boolean
byte, java.lang.Byte xsd:byte
short, java.lang.Short xsd:short
int, java.lang.Integer xsd:int
long, java.lang.Long xsd:long
float, java.lang.Float xsd:float
double, java.lang.Double xsd:double
java.lang.String xsd:string
java.math.BigInteger xsd:integer
java.math.BigDecimal xsd:decimal
java.util.Calendar xsd:dateTime
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
14/47
java.util.Date xsd:date
javax.xml.rpc.namespace.Qname xsd:QName
Binary stream coded using Base64 coding in a byte array
(byte[])
xsd:base64Binary
Binary stream coded as a character string with hexadecimal
representation (java.lang.String)
xsd:hexBinary
Any Java type whose values can be represented as a character
string
xsd:anyType
Axis also enables complex types to be used in SOAP exchanges:
Java class XML-Schema or SOAP data type
java.util.Map
Represented by a complex type (xsd :complexType). Each
value-key pair in the map is represented by the "generic"
type xsd:anyType.
org.w3c.dom.Element Represented as an XML element
java.util.Vector
Represented by a complex type (xsd :complexType ). The
elements of the vector are represented by the "generic" type
xsd :anyType.
Array of simple or complex type
elements
Represented by a SOAP array type (soapenc :arrayType).
Array elements are represented by the corresponding simple
or complex type.
JavaBeans Represented by a complex type (xsd :complexType)
Enumerations of numeric or
alphanumeric values mapped to
character strings or numeric types
Represented by type xsd:enumeration.
Support for all simple types except Boolean, xsd :dateTime,
xsd :QName, xsd :base64Binary and xsd :hexBinary
On the Axis server, mappings between Java and XML types are stored in a Type Mapping
Registry. Each type mapping contains various information:
An identifier (URI) describing the encoding style used for XML encoding of values
of this type.
A Qualified Name or QName: this is the unique identifier for this datatype. A
QName has two parts: a namespace (URI) and type name.
The names of Java classes to be used for serialization and deserialization of Java
objects in XML.
2.5 Support for Out and I n-Out parameters
The SOAP and WSDL specifications have greatly evolved, and now describe two new
types of parameters for RPC exchanges: Out parameters and In-Out parameters. These
new parameter types remedy one of the main limitations of the first version of the SOAP
protocol, in which RPC exchanges were limited to a single return value.
The new parameter types provide greater flexibility when designing Web services based
on the RPC model:
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
15/47
The Out parameters can be used for implementing services sending several return
values, without requiring the return values to be wrapped in a single complex
type. The Web service fixes the value of the Out parameters that will be sent back
to the caller.
The In-Out parameters enable you to simulate a model for parameter passing by
reference: these are in parameters whose value can be modified by the Web
service, and which are returned as return parameters.
Given that the Java language itself does not natively support the concept of Out or In-
Out parameters, implementation of these mechanisms poses a problem, which can be
resolved by using Holder classes. The mechanism of these holder classes is defined by
the JAX-RPC specification (this mechanism is similar to that used by the CORBA Java
implementation).
JAX-RPC defines Holder classes for each of the primitive Java types in the
javax.xml.rpc.holders package.
It is possible to define your own holder classes to contain an instance of a particular
class. This involves creating a final (non-derivable) class which implements the interface
javax.xml.rpc.holders.Holder (this is a marker interface, that does not define any
method signature). This Holder class must:
obey the naming convention for Holder classes: the class name must take the
format: "NameOfClassContainedHolder".
contain a public instance variable of the required class
define a default constructor
define a constructor that takes as a parameter an object from the required class
and assigns it to the corresponding instance variable.
Example:
Taking the "Article" class, we will define the corresponding holder class "ArticleHolder" as
follows:
public final class ArticleHolder implements javax.xml.rpc.holders.Holder
{ // public instance variable of class Article
public Article ref;
public ArticleHolder()
{ // default, no-argument constructor
}
public ArticleHolder(Article value)
{ // parameterized constructor to assign a value to the member reference
this.ref = value;
}
}
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
16/47
2.6 Security support
The successive versions of the SOAP specification (1.1 and 1.2) have omitted any
definition of rules or mechanisms for managing security issues (authentication and
control of access to services, as well as confidentiality, integrity and non-repudiation of
messages). Work is currently underway to remedy these shortcomings, and to provide
extensions to the SOAP specification to define a certain number of security mechanisms.
Some of these mechanisms are based on the use of information from SOAP message
headers, and there are also plans to offer message signature mechanisms (SOAP
Security Extensions: Digital Signature). Pending the standardization of security
mechanisms for SOAP, the specification leaves the way open for implementation of
specific mechanisms (based on the use of headers in messages, or using the security
mechanisms of the underlying transport protocol used for SOAP exchanges).
Meanwhile, the JAX-RPC specification expressly requires support for the "Basic" HTTP
authentication model for implementations of SOAP over the HTTP transport protocol.
In this context, Axis meets the requirements of the JAX-RPC specification and offers two
security models that can be used via SOAP exchanges over HTTP:
Simple integrated security model (Simple Security Provider)
This is the default security model in Axis. The list of users and passwords for
authentication must be stored in the WEB-INF sub-directory of the Axis Web
application deployed on the host Servlet container, in a flat file called users.lst. Each
line of this file contains a username-password pair, separated by a space.
Another flat file called perms.lst, in the same directory, can be used to define access
restrictions for the services published on the server. The syntax for defining access
restrictions is simple: each line in the file contains the following information,
separated by a space: a username, followed by one or more names of services which
this user is authorized to access.
In this model, the security credentials of the user must be retrieved from information
in the HTTP header. A specific message handler carrying out the operation
(org.apache.axis.handlers.http.HTTPAuthHandler) must therefore be deployed on the Axis server in
the transport request chain for the HTTP protocol. As the default configuration of the Axis server
includes deployment of this handler, no modification will generally be required on the
configuration.
Security model interfaced with Servlet API (Servlet Security Provider)
This security model is based on the standard security models of the J2EE Servlet API,
and uses the authentication and access authorization mechanisms of the host server
on which the Axis server is deployed. The user referential employed to authenticate
users with their password therefore depends on the Servlet container used.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
17/47
As regards definition of access authorizations, this model is implicitly based on the
access restriction definition mechanism of the Servlet API (definition of access
restrictions in WEB-INF/web.xml deployment descriptor of Web applications).
Therefore, in the deployment descriptor of the Axis Web application, it will be
necessary to specify the restrictions for access to the URLs of deployed services.
Authentication is generally activated for each service deployed, by configuring
deployment of the relevant message handlers in the corresponding service request chain:
For each service requiring user authentication, the authentication handler must be
deployed: org.apache.axis.handlers.SimpleAuthenticationHandler. By default the
authentication handler uses the simple security provider (org.apache.axis.
security.simple.SimpleSecurityProvider). If you wish to use the Servlet Security
provider (org.apache.axis.security. servlet.ServletSecurityProvider), you will
need to attribute the name of this security provider as a value of the
"securityProvider" parameter for the authentication handler in the service
deployment descriptor.
For each service requiring access authorization checking in addition to
authentication, the corresponding handler must also be deployed:
org.apache.axis.handlers.SimpleAuthorizationHandler .
The security management functionality provided by Axis is promising, although it is
somewhat rudimentary at present, and unfortunately is very poorly documented.
2.7 Session management
Axis defines an abstract representation of a session (org.apache.axis.session.Session
class), which enables use of an extendable set of underlying implementations.
For the time being, Axis offers an implementation of this session model which employs a
hashtable for storing session information (org.apache.axis.session.SimpleSession class).
With this implementation it is possible to store any type of object in session (including
non-serializable objects).
As regards transmission of the session ID in SOAP exchanges, Axis proposes a smart
mechanism, independent of the underlying transport used, which is based on use of a
SOAP header block for transmission of the session ID between the client and the server.
(In a future version, Axis may also offer another mechanism, especially for HTTP
transport, based on the use of cookies.)
A specific message handler is used for managing sessions and sending the session ID in
messages: org.apache.axis.handlers.SimpleSessionHandler. This handler must be
deployed both on the client and server side.
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
18/47
Evidently, the session management mechanism only works if Axis is used both as the
Web Services platform and as the client for accessing these services. There are not yet
any solutions to ensure interoperability in terms of session management between Axis
and other Web Service implementations.
Furthermore, the documentation available on session use is still too short, and no
examples are provided (oddly, the Axis FAQ does provide an example of use, though,
test.session.TestSimpleSession, which remains impossible to find in the distribution!).
2.8 Automatic code generation
Axis features powerful code generation functionality based on the Java mapping
mechanisms of JAX-RPC. These improved functions can be used via two Java utilities:
The Java2WSDL enables you to automatically generate, from a Java interface or
class, a WSDL description which represents the "translation" of this Java interface
into an XML RPC interface.
The WSDL2Java tool makes it possible to generate the following, from the WSDL
description of a service:
- a JAX-RPC framework of interfaces and client proxy classes to considerably
simplify development of a client for this service
- A JAX-RPC framework of server-side interfaces and classes for creation and
deployment of a service that implements the functions defined in the WSDL
description
2.9 Administration
The Administration section of Axis has been completely overhauled since Apache SOAP,
in which administration and deployment were based on a Web interface.
Within the AxisEngine, the administration service (for configuration of the server and
deployment of services) is now a Web service itself (message-based SOAP service),
deployed as "AdminService."
However, there is still a Web administration interface (managed by the AdminServlet),
although it is extremely rudimentary; it can be accessed at the following address:
http://hostname:port/axis/
The functions offered by this Web interface are very limited:
the Administer Axis option is used to start or stop the Axis server
the Visit the Axis Servlet option is used to list the services deployed on the Axis
server and the names of the methods exposed by each of these services.
The majority of the administration tasks for Axis will therefore be carried out using the
administration Web service, whose SOAP access point is found at the following address:
http://hostname:port/axis/services/AdminService
2002 TechMetrix Research - SQLI Axis: The New Incarnation of Apache SOAP
19/47
The functions offered by Axis' administration service may be divided into two categories:
configuration of AxisEngine: configuration of global server properties, and
message handler chains (global, transport and service chains), transport
protocols, and mappings of types used
deployment of services within Axis
To carry out the various administration tasks, Axis features a command-line Java SOAP
client, which effectively replaces a Web interface:
org.apache.axis.client.AdminClient.
As Axis' administration service is a Web service, the AdminClient dialogs with this service
via SOAP messages. The administration commands to be performed are defined in XML
command files which must be passed as parameters to the administration client.
These XML command files conform to an XML grammar specific to Axis, called "WSDD"
("Web Service Deployment Descriptor"). So, to deploy a service in Axis, you write an XML
deployment file for the service ("deploy.wsdd") which is passed as a parameter to the
administration client:
java org.apache.axis.client.AdminClient deploy.wsdd
The administration service examines and executes the commands contained in the
deployment descriptor and adjusts the configuration of the server as necessary. The
server configuration information is stored in a file called server-config.wsdd , which is
located in the WEB-INF sub-directory of the Axis Web application.
This configuration file contains several sections:
one section for the global configuration parameters of the server:
<globalConfiguration>
one section for each Web service deployed: <service>
In some cases, it is necessary to modify this configuration file manually, particularly if
configuring remote access to the administration service.
To authorize remote administration of Axis, which is not enabled by default, you must
directly modify the value of the "enableRemoteAdmin" parameter in the server's
configuration file, in the <service> section corresponding to the "AdminService". It is
also possible to define a password for accessing the administration service
("adminPassword" parameter) in the global configuration section of the server:
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
</globalConfiguration>