Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

Sponsored Links

Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs

XML messaging, Part 3

The JAXM and ebXML APIs set the new standard for XML messaging

  • Print
  • Feedback
With the advent of Web services, XML messaging has become an important component of the J2EE (Java 2, Enterprise Edition) technology solution set. Within the XML messaging realm, JAXM (Java API for XML Messaging), Sun's general-purpose API for creating and processing XML messages, combined with the ebXML (electronic business XML) standard for conducting electronic business, help standardize and simplify XML messaging.

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.

What is JAXM?

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.

JAXM APIs

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.

javax.xml.messaging

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.

javax.xml.soap

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.

  • Print
  • Feedback
What is Tech Briefcase?
TechBriefcase is a new, free service where IT Professionals can Search, Store and Share IT white papers and content like this. Learn more
Bookmark content
Speed up your research efforts with content across the web.
Search and Store
Find the white papers you need. Create folders for any topic.
View Anywhere
Open your briefcase on your iPhone, tablet or desktop. Share with colleagues.
Don't have an account yet?

Resources