Java API for XML Messaging
   HOME

TheInfoList



OR:

The Java API for XML Messaging (JAXM) enables distributed software applications to communicate using
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
(and
SOAP Soap is a salt of a fatty acid used in a variety of cleansing and lubricating products. In a domestic setting, soaps are surfactants usually used for washing, bathing, and other types of housekeeping. In industrial settings, soaps are use ...
). JAXM supports both asynchronous and synchronous messaging. JAXM is one of the
Java XML {{unreferenced, article, date=April 2008 The Java programming language XML APIs developed by Sun Microsystems consist of the following separate computer-programming APIs: * Java API for XML Processing, or JAXP * Java API for XML Messaging, or ...
programming
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
s


Overview

The
Java API There are two types of Java programming language application programming interfaces (APIs): * The official core Java API, contained in the Android (Google), SE (OpenJDK and Oracle), MicroEJ. These packages (java.* packages) are the core Java la ...
for XML Messaging (JAXM) enables developers to us
XML messaging
using the Java platform. Developers can create and send XML messages over the internet using the JAXM API. Also, Java API for XML Messaging has several advantages over
Remote Procedure Call In distributed computing, a remote procedure call (RPC) is when a computer program causes a procedure ( subroutine) to execute in a different address space (commonly on another computer on a shared network), which is coded as if it were a normal ( ...
such as the following: *One-way (asynchronous) messaging *Routing of a message to more than one party *Reliable messaging with features such as guaranteed delivery The complete JAXM API comes with two packages:
javax.xml.soap:
This package contains the API for creating and populating a SOAP message.

This package allows one to send one-way messages via a messaging provider.


Messages

Messages in JAXM are XML messages that follow the prescribed SOAP format and standards. There are two main types of SOAP messages: those that have attachments and those that do not. For example, if you want your message to contain an image, you must send an attachment with the message. The SAAJ API provides the AttachmentPart class for attachments in SOAP messages.


Connections

A connection is required to send and receive all SOAP messages. The connection can go to a messaging provider or a particular destination. The JAXM API provides the class and interface to represent two kinds of connections:

€”a connection from the sender directly to the receiver (a point-to-point connection)

€”a connection to a messaging provider


SOAP Connection

A SOAPConnection is a point-to-point connection for sending messages directly to a remote party. A SOAPConnection object, which represents a point-to-point connection, is simple to create and use. 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 way for a client to have a connection without a service 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 keeps track of messages and routes them to the correct destination or destinations. It is a service that handles the transmission and routing of messages.


When to use a Messaging Provider

A JAXM client may or may not use a messaging provider. Generally, you do not need a messaging provider if you just want to be a consumer of Web services. Some 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 Some advantages to not using a messaging provider are the following: *The application can be written using the J2SE platform *The application is not required to be deployed in a servlet container or a J2EE container *No configuration is required


References


See also


JSR 67: Java(TM) APIs for XML Messaging

Java API for XML Messaging (JAXM) Specification 1.1

SOAP with Attachments API for Java (SAAJ) Specification 1.3


- this package is specified in the JAXM 1.1 specification

- this package is specified in the SAAJ 1.3 specification



{{Java EE 7 Java API for XML