Web services scenario: Dynamic inquiry on supplier
This document describes a scenario in which an online garden supply retailer uses Web services to perform an inventory search of several wholesale suppliers.
In the "static inquiry on suppliers" scenario, the Plants by WebSphere IT staff establishes connections with each supplier separately, and makes changes as suppliers come and go. It would be convenient to query multiple suppliers at the same time, without necessarily even providing a list of particular suppliers to query. Furthermore, Plants by WebSphere managers would like to be able to shop around quickly according to criteria such as the lowest wholesale price or fastest availability.
In a "dynamic inquiry on suppliers" scenario, several plant and garden suppliers have published Web services to a Universal Description, Discovery, and Integration. (UDDI) registry. Suppliers create inventory Web services that use a standard interface. They publish their Web services to the centralized registry. Perhaps the registry has been established by the Plant Wholesalers Association. Or maybe a small Internet company established the buyer-seller site after finding that suppliers and retailers each would pay a small monthly rate for the convenience of the service.
How out of stock items are handled
The following events happen when a customer on the Plants by WebSphere site orders an item that is not available according to the Plants by WebSphere inventory.
- In advance, the suppliers publish their Web services to a UDDI registry for just such an occasion.
In this way, they notify inquiring retailers, such as Plants by WebSphere, that their inventories are available to check.
- Plants by WebSphere checks its own inventory.
The application powering the Web site checks the Plants by WebSphere inventory database. It discovers that the item is not in stock.
- Plants by WebSphere uses a UDDI4J client to consult the UDDI registry for suppliers whose inventories it can check.
Plants by WebSphere can invoke a Web service that queries the UDDI registry for suppliers. Then in turn, the Web service at the site of each supplier is invoked. The administrator is presented with a list of suppliers from which the requested item is available, perhaps including price and availability data.
- Plants by WebSphere uses the Web services to check the supplier inventories.
The application invokes a Web services for J2EE client or JAX-RPC 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.
- Plants by WebSphere either obtains the out of stock item, or does not.
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.
- Plants by WebSphere notifies its customer of the outcome, as soon as possible.
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.
Web services technologies used in this scenarioThis scenario uses the following Web services technologies.
XML (Extensible Markup Language) XML is used to standardize the exchange of data between Plants by WebSphere and its supplier.
Web Services for J2EE Web Services for J2EE, also known as JSR-109, defines how J2EE applications create and access Web services.
Java API for Remote Procedure Calls JAX-RPC, also known as JSR-101, defines how Java applications access Web services.
WSDL WSDL is used to turn the existing application into a Web service, by acting as the interface between the underlying application and other Web-enabled applications.
SOAP (Simple Object Access Protocol) SOAP is the protocol by which the Web service communicates with the supplier over the Internet.
A Universal Description, Discovery and Integration (UDDI) registry
By publishing their Web services to UDDI, suppliers make them available for Plants by WebSphere and other retailers to discover and reuse. This saves development time, effort and cost, and helps minimize the need to maintain several different implementations of the same application at Plants by WebSphere and various other retailers who need to contact the suppliers for inventory data.
Particular editions of WAS provide a private UDDI registry that can be used in an intranet environment.
See AlsoOverview: Online garden retailer Web services scenarios
Web services scenario: Static inquiry on supplier
Web services scenario: Cross supplier inquiry
Using Web services based on Web Services for J2EE