In this scenario, an online supply retailer turns an application into a Web service for checking the inventory of its main supplier.
Plants by WebSphere is an Internet storefront that sells plants and gardening supplies. The company realizes that its existing Web application can be "wrapped" with Web services programming interfaces. For example, the BackOrderStock session bean can be turned into a SOAP Web services client that interacts with a Supplier Web services application located at the supplier. Specifically, the BackOrderStock session bean functionality is turned into a Web services for J2EE client and a JAX-RPC client. These two client are J2EE and Java standards for Web services clients.
How out of stock items are handled
The application powering the Web site checks the Plants by WebSphere inventory database. It discovers that the item is not in stock.
The application invokes a SOAP client that communicates with a SOAP server at the supplier site to ascertain whether the supplier has the item in stock. The supplier data is sent to Plants by WebSphere.
If the supplier indicates that the item is in stock, the application powering Plants by WebSphere determines whether to order the item on behalf of the customer. The exchange of data can include checking a price threshold above which Plants by WebSphere will not order the wholesale item. It could also include decision-making information such as how long the supplier will require to deliver the item, or a date on which the manufacturer plans to discontinue the item.
If the supplier can be consulted quickly enough, Plants by WebSphere does not have to bother its customer with concerns about availability. It simply confirms that the item is available, as though the item is in stock at Plants by WebSphere. If the supplier inventory temporary lacks the item, or Plants by WebSphere opted not to order the item from the supplier, Plants by WebSphere will issue an appropriate response to the customer.
See the Samples Gallery for details of the GreenhouseByWebSphere application, a business to business (B2B) application that uses a message-driven bean (MDB), a stateless session bean, and Java message service.
Web services technologies used in this scenario
This scenario uses the following Web services technologies.Related concepts
Overview: Online garden retailer Web services scenarios
Web services scenario: Dynamic inquiry on supplier
Web services scenario: Cross supplier inquiry
Related tasks
Implementing Web services applications
Related information
Samples page on IBM
site