Java API for XML Messaging
The Java API for XML Messaging (JAXM) enables distributed software applications to communicate using XML (and SOAP). JAXM supports both asynchronous and synchronous messaging. JAXM is a replacement for SOAP with Attachments API for Java
JAXM is one of the Java XML programming APIs
Overview
The Java API for XML Messaging (JAXM) enables developers to write business applications that support emerging industry messaging standards based on the SOAP.

Messages
JAXM messages follow SOAP standards, which prescribe the format for messages and also specify some things that are required, optional, or not allowed. With the JAXM API, you can create XML messages that conform to the SOAP specifications simply by making Java API calls.
Connections
All SOAP messages are sent and received over a connection. The connection can go directly to a particular destination or to a messaging provider. The JAXM API supplies the following class and interface to represent these two kinds of connections:
- javax.xml.soap.SOAPConnection -- a connection from the sender directly to the receiver (a point-to-point connection)
- javax.xml.messaging.ProviderConnection -- a connection to a messaging provider
SOAP Connection
A SOAPConnection object, which represents a point-to-point connection, is simple to create and use. One reason is that you do not have to do any configuration to use a SOAPConnection object because it does not need to run in a servlet container (like Tomcat) or in a J2EE server. It is the only kind of connection available to a client that does not use a messaging provider.
Provider Connection
A ProviderConnection object represents a connection to a messaging provider. (The next section explains more about messaging providers.) When you send a message via a ProviderConnection object, the message goes to the messaging provider. The messaging provider forwards the message, following the message's routing instructions, until the message gets to the ultimate recipient's messaging provider, which in turn forwards the message to the ultimate recipient.
Messaging providers
A messaging provider is a service that handles the transmission and routing of messages. It works behind the scenes to keep track of messages and see that they are sent to the proper destination or destinations.
When to Use a Messaging Provider
A JAXM client may or may not use a messaging provider. Generally speaking, if you just want to be a consumer of Web services, you do not need a messaging provider. The following list shows some of the advantages of not using a messaging provider:
The application can be written using the J2SE platform The application is not required to be deployed in a servlet container or a J2EE server No configuration is required The limitations of not using a messaging provider are the following:
The client can send only request-response messages The client can act in the client role only