Most read:
Popular archives:
JavaWorld's new look is here!
We've upgraded the site with a fresh look-and-feel, improved topical navigation, better search, new features, and expanded
community platform. Learn more about the changes to JavaWorld.
| Oracle Compatibility Developer's Guide |
| The Explosion in DBMS Choice |
Read the whole "XML Messaging" series:
In this article, the last of three, I cover JAXM and ebXML in three sections. First, I discuss JAXM: its purpose, the APIs it defines, its configuration, and so on. After JAXM, I move on to ebXML and its major features. Finally, I wrap up with JAXM and ebXML examples.
The JAXM specification's stated mission is to provide a SOAP (Simple Object Access Protocol)-message-oriented API for Java. Note: I've based this JAXM overview on the JAXM specification version 0.9.3 and its latest available reference implementation, August 2001.
You'll find the JAXM API straightforward. The API has roots in JMS (the Java Message Service), and so you'll notice the close
similarity between the two. JMS has a ConnectionFactory, JAXM also has a ConnectionFactory; JMS has a MessageListener interface, as does JAXM; and so on. On another point, JAXM uses DOM4J and JDOM as the encapsulation mechanism for XML documents
(which are messages).
JAXM clients can assume two basic roles in JAXM: sender and/or receiver. The sender role sends messages to other JAXM clients acting as receivers. The receiver role receives messages sent by other sender JAXM clients. A JAXM client can play either one or both of these roles.
To work with JAXM, you also need to understand the concept of providers. A JAXM provider is a product or package that provides an actual implementation of the JAXM APIs, allowing different packages to offer a JAXM layer over an existing product. Again, there are parallels with JMS.
JAXM supports both the SOAP specification and the SOAP Attachment specification. JAXM assumes this base level of support. In addition, although SOAP messaging standards such as ebXML or BizTalk are not yet specified, message profiles layer them onto JAXM.
Now that you understand some of JAXM's concepts, let's now dive into the actual API, which is broken into a messaging package and a soap package.
The messaging package holds the classes, interfaces, and so on required for sending and receiving SOAP messages. Moreover, it contains
the Connection class to connect to the JAXM provider and to send messages, as well as the MessageListener class for receiving messages.
The soap package provides the classes necessary for encapsulating SOAP messages. You'll find classes for SOAP header, body, elements,
and so on. Many classes in the current implementation extend DOM4J and JDOM classes to achieve their functionality, so familiarity
with both technologies will help you here.