SOAP (see SOAP Support for Java Clients) allows for the exchange of structured data (specified by an XML scheme) 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 obtain 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 into a JMS message, and to extract a SOAP message from a JMS message. The J2EE platform provides the package java.xml.soap, which you can use to assemble and disassemble a SOAP message.
Use the objects defined in the java.xml.soap package to construct a SOAP message, or use the servlet defined in thejavax.xml.messaging package to receive a SOAP message, or use a web service like JAX-RPC to receive a SOAP message.
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 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 Sun Java System Message Queue 3.7 UR1 Developer’s Guide for Java Clients.