To expedite the development of web services, architectures supporting asynchronous interactions are preferable, particularly when working with long-running web services for a client. Devising a mechanism to effect asynchrony for the web service is the topic of a Sun Developer Network Site article that covers the concepts and issues behind this type of development.
Utilizing the JavaTM Messaging Service (JMS) in the Sun JavaTM Studio Enterprise 7, authors Rico Cruz and Marina Sum provide an example of creating an asynchronous web service that answers the real-world demands of clients through this conversational and document-oriented solution.
Two approaches are available when implementing asynchronous interactions for clients. The first is callbacks where the client acts as a web service and the service acts as a client. With callbacks, the client is notified when the results are ready. The other approach is polling that allows a client to periodically call to check whether results are ready. Cruz and Sum implement polling in their example, citing its simplicity of use.
Another consideration with asynchronous web services is correlating messages, which can be enabled in several ways. This article demonstrates how to implement this procedure through the use of a JMS header to pass correlation data, in addition to information on other methods.
In the article's example, Cruz and Sum tackle the process of creating an asynchronous web service for loan applications using the Sun Java Studio Enterprise 7. From the initial steps of setting up the process and its business methods to the actual creation steps and test client, this article's example works through the development procedure that formulates a simple asynchronous web service in the Sun Java Studio Enterprise 7 with JMS.
To read this complete article entitled "Developing Asynchronous Web Services with Java Message Service in Sun Java Studio Enterprise 7," visit:
Read More ...