Simple Object Access Protocol (SOAP) allows for the exchange of structured data (specified by an XML schema) between two peers in a distributed environment. Sun’s implementation of SOAP does not currently support reliable SOAP messaging nor does it support publishing SOAP messages. However, you can use the Message Queue service to achieve reliable SOAP messaging and, if desired, to publish SOAP messages. The Message Queue service does not deliver SOAP messages directly, but it allows you to wrap SOAP messages into JMS messages, to produce and consume these messages like normal JMS messages, and to extract the SOAP message from the JMS message.
Message Queue provides SOAP support through two packages: javax.xml.messaging and com.sun.messaging.xml. You can use classes implemented in these libraries to receive a SOAP message, to wrap a SOAP message as a JMS message, and to extract a SOAP message from a JMS message. The Java EE platform provides the package java.xml.soap, which you can use to assemble and disassemble a SOAP message.
To achieve reliable SOAP messaging you need to implement the following sequence of actions:
Use the Message Transformer utility to convert the SOAP message into a JMS message.
Send the JMS message to the desired destination.
Consume the JMS message asynchronously or synchronously.
After the JMS message is consumed, use the Message Transformer utility to convert it into a SOAP message.
Use the SOAP with Attachments API for Java (SAAJ) API (defined in the java.xml.soap package) to disassemble the SOAP message.
For detailed information about SOAP messages and their processing, see Chapter 5, Working with SOAP Messages, in Oracle GlassFish Message Queue 4.4.2 Developer’s Guide for Java Clients.