HTTP and JMS transport methods
Web Services created using the WebSphere run-time environments support a JMS transport layer in addition to the existing HTTP transport. This allows Web service clients and servers to communicate using JMS queues and topics instead of HTTP connections. Both one-way and synchronous two-way requests are supported. Note that a Web service must be implemented as an EJB if it will be accessible through the JMS transport.
The benefits of using JMS as an alternative to HTTP include the following:
- Request and response messages are sent by way of reliable messaging.
- One-way requests allow client and server to be more loosely-coupled (the server does not have to be active when the client sends the one-way request).
- One-way requests can be sent to multiple servers simultaneously through the use of a topic.
If a Web service is to be accessible on the JMS transport, then the corresponding WSDL document should include a JMS binding and a SOAP address which specifies a JMS endpoint URL string. A JMS binding is simply a wsdl:binding element which contains a wsdlsoap:binding element whose transport attribute ends in soap/jms, rather than the normal soap/http value. In addition to the JMS binding, a wsdl:port element which references the JMS binding should be included in the wsdl:service element within the WSDL document. This wsdl:port element should contain a wsdlsoap:address element whose location attribute specifies a JMS endpoint URL string.
You also need to decide on the names and types of JMS objects that your application will use. For example, decide whether your Web service will receive its requests from a queue or a topic. You also must decide whether to use a secure destination (queue or topic). Finally, you will need to decide on the names for your destination, connection factory, and listener port. The following list provides an example of the names that might be used for the sample StockQuote Web service:
- Queue: StockQuote_Q (JNDI name: jms/StockQuote_Q)
- Inbound queue connection factory: StockQuoteQCF (JNDI name: jms/StockQuoteQCF)
- Outbound queue connection factory: WebServicesReplyQCF (JNDI name: jms/WebServicesReplyQCF). This is a reserved, case-sensitive name. You cannot give your outbound queue connection factory any other name.
- Listener port: StockQuoteEJB_ListenerPort (connection factory cannot be jms/WebServicesReplyQCF)
After creating your Web service, you can run the Endpoint Enabler tool to add a JMS endpoint (router module) for each Web service-enabled EJB .jar contained in the EAR file. If you create the Web service using the Web services wizard, this is done for you automatically.
Creating a JMS server
In order to create a Web service that uses JMS transports, you need to first create and configure a server that can support JMS.
Related Concepts
../../com.ibm.etools.webservice.doc_6.0.0/concepts/cws.html
../../com.ibm.etools.webservice.doc_6.0.0/concepts/cwsinwsa.html
../../com.ibm.etools.webservice.doc_6.0.0/concepts/cruntime.html
Related Tasks
Developing Web services
Endpoint Enabler