SOAP/JMS Web Services sample

Introduction :

SOAP/JMS web services

JMS is a transport level API that enterprises can combine with web service solutions for messaging, data persistence, and access to Java-based applications. A SOAP/JMS web service is a web service that implements a JMS queue-based transport.

A web service solution may implement a JMS destination for a queue or a topic. The connector's SOAP/JMS protocol listener supports queue destinations only; topics are not supported. JMS text messages only are supported.

During event processing, a SOAP/JMS web service client wraps a request message with a JMS message and publishes it to the queue whose JMS destination is a connector. The JMS destination retrieves the JMS message containing the web service request and extracts the SOAP request message from the JMS message. It then processes the SOAP request message.

Synchronous SOAP/JMS web service

For synchronous connector processing (Request/Response), a response message is wrapped with a JMS message (like that of the request message). The JMS message containing the web service response is then sent to the JMSReplyTo queue from the incoming request. JMS headers in the response message are set to the values of the headers in the JMS request message as follows:


Asynchronous SOAP/JMS web service

From the perspective of connector processing, an asynchronous SOAP/JMS web service is one that follows a request-only path. If the SOAP/JMS protocol listener successfully receives and processes a request-only web service message, no JMS message containing a response is returned to the client. If a ReplyToQueue is configured and a fault occurs upon receipt of a JMS message, a fault message is returned to the web service client. In addition, if an ErrorQueue is specified in the SOAP/JMS listener, the fault message is archived there.

The SOAP/JMS protocol listener consists of a thread that continuously listens on the InputQueue, which is the JMS destination for requests from web service clients. The RequestWaitTimeout connector configuration property defines how long the listener will wait for a request before checking whether the connector has shut down.
When a web service client initiates a SOAP/JMS request, it sends a SOAP request message to the InputQueue on which the SOAP/JMS listener is listening. When it receives the SOAP request message from the InputQueue, the SOAP/JMS protocol listener registers the request with the protocol listener framework. The protocol listener framework schedules the request as and when resources are available.

Web Services technology is implementation of Service Oriented Architecture, which promotes effective standards based application integration approaches and permits a faster response to the changing business requirements.

Sample
This sample will demonstrate the Message Broker's capability to implement Synchronous SOAP/JMS web services. You can also implement the Asynchronous SOAP/JMS web services using Message Broker.

The SOAP/JMS web services sample is implemented using an e-Retail application integration scenario. A request message comes from an e-Retail web application to retrieve item details from the database. The task of retrieving the item details from the database is provided as web service. Accessing the webservices over JMS and getting the item details can be achieved using Message Broker.

The "SOAP/JMS Web Services" sample contains two message flows.


  1. Client Message Flow : The client application puts the SOAP Request message in the Client message flow. This client application can be a any application. Here it is assumed as a MQ Application. This message flow is used to transform the SOAP MQ request message into a SOAP JMS request message and to set the JMS ReplyToQueue in the JMS Header before sending the SOAP request to the JMS Destination. The JMS ReplyToQueue can be set using JMSOutput Node of Message Broker. JMSOutputNode is also used  to put the SOAP request  message in JMS destination queue. Here point-to-point type of messaging is used. The JMSOutputNode is configured for point-to-point messaging. The client message flow waits at JMS ReplyToQueue to get the SOAP reply message. Once it receives the SOAP reply message, it converts it into MQ message and sends it to the Client Application.
  2. The web services is simulated by creating a WebService message flow. The WebService flow gets the request message from the JMS Destination queue. It retrieves the requested data from the database, creates the SOAP Reply message and sends the reply back to the JMS ReplyToQueue.

The sample uses WebSphere MQ as the JMS provider. Make sure the you have install the JMS client component if you are using the version lower the 6.0 of MQ.

Click the following links to find out more about the sample and how to get the pre-built sample running using the wizards.

Read about the sample

Import and deploy:
5 minutes

You can set up the sample in one of the following ways:


            Note: On Unix platforms, you need to modify the "Location JNDI bindings" property of the JMSInput Node and JMSOutput Node present in the sample Message flows and then create a new bar file to deploy the sample on Broker. More details are about JNDI configuration are present in the Setup instructions  for all platforms.

On Linux, AIX, Solaris and HP-UX systems, follow manual Setup instructions before running the sample.
Setup instructions

Run the sample

Extend the sample

When you have finished with the sample, you can remove it in one of the following ways: