WebSphere Application Server supports the use of the Java Message Service (JMS) API to transport Web services requests, as an alternative to using HTTP. By using the JMS transport, your Web service clients and servers can communicate through JMS queues and topics instead of HTTP connections. One-way and synchronous two-way requests are supported.
Before you begin
A Web service must be implemented as an enterprise bean to be accessed through the JMS transport.
Review the Javadoc for a complete list of API's. You can also review several articles about the development of Web services at Web services: Resources for learning.
Why and when to perform this task
The benefits of using JMS include:
Perform this task after you have developed or implemented a Web service. This task explains how to configure the Web service to use JMS to transport the requests.
To configure a Web service to use JMS as a transport:
Steps for this task
The WSDL file of a Web service must include a JMS binding and a SOAP address, which specifies a JMS endpoint URL string, to be accessible on the JMS transport. A JMS binding is a wsdl:binding element that contains a wsdlsoap:binding element whose transport attribute ends in soap/jms, rather than the typical soap/http value.
In addition to the JMS binding, a wsdl:port element referencing the JMS binding must be included in the wsdl:service element within the WSDL file. The wsdl:port element contains a wsdlsoap:address element with a location attribute that specifies a JMS endpoint URL string.
Before your application can be installed, you need to:
The following list provides examples of the names that might be used for a Web service called StockQuote:
After you decide on the names and types of the JMS objects, use the administrative console or the wsadmin scripting interface to define the JMS objects.
For a secure JMS connection, add the basicAuth assembly property to the ibm-webservicesclient-bnd.xmi deployment descriptor file. Set the user ID and password attributes.
If the basicAuth property is not provided in the ibm-webservicesclient-bnd.xmi deployment descriptor file, the JMS connection can be rejected, depending on the security configuration of the JMS provider.
During the installation process you are prompted for two types of information for each Web service-enabled EJB JAR contained in your EAR file:
If your Web service contains two-way operations, the MDB listener that is defined inside the JMS endpoint added by endptEnabler command, needs to access a queue connection factory to add a reply message to the reply queue.
The MDB listener uses a resource environment reference of java:comp/env/jms/WebServicesReplyQCF. Therefore, during the application installation process, you must provide the actual JNDI name of the queue connection factory for the MDB listener to use for that Web service. You might want to use the same connection factory that you defined for use by clients in step 2.
A listener port is an object that is used to associate a JMS connection factory with a JMS destination (queue or topic). When deployed, an MDB is configured with the correct listener port so that messages from the queue or topic are properly delivered to the MDB. During deployment, you can modify the name of the listener port that is associated with each MDB listener. The listener port name contained in the input EAR file is displayed as a default value. If you specify the correct listener port name to the endptEnabler command, you can accept the default value. Otherwise, enter the correct listener port name.
Hint: By default, the endptEnabler command produces listener port names of the form <ejb-jar-name>_ListenerPort. To simplify this step, define the listener ports that follow this naming convention during step 2.
Results
You have a Web service that is configured to use JMS to transport the requests.What to do next
Publish the WSDL file.