Overview: Online garden retailer Web services scenarios
This set of scenarios is inspired by an online retailer called Plants by WebSphere, which uses Web services support in WAS to improve communications with its suppliers. The more advanced scenarios describe Web services support available only in particular editions of WAS. Consult your product documentation to confirm what is supported by your edition.
You might recognize Plants by WebSphere as a sample application available in the WebSphere Samples Gallery. These scenarios are loosely related. They describe how the fictional online retailer could use a variety of Web services technologies, some of which are beyond those currently demonstrated by the sample.
Web services are middleware. Using Web services you can connect applications together, no matter how each application is implemented or where it is located. For example, Web services can connect retailers to wholesale suppliers. Middleware is not new. What is new in Web services is that this connectivity is based upon open standards and Web technologies. Web services operate at a level of abstraction that is similar to the Internet, and they can work with any operating system, hardware platform or programming language that can be Web-enabled.
The Plants by WebSphere storefront sells plants and gardening supplies. As customers order merchandise, the site checks the merchandise availability in its inventory database. The scenarios show how the inventory system can grow in stages, using various Web services technologies to improve its capabilities.
- Before Web services
As featured in the Samples Gallery, the Plants by WebSphere application already has Web services capabilities. See below for a description of how the online garden retailer might have operated prior to adopting Web services technology. Key Web services components are introduced. To determine which components are available with the particular editions of WAS that you have purchased, consult the documentation for each edition.
- Static inquiry on supplier
In this scenario, the garden retailer turns the existing Web application into a Web service for checking the inventory of its main wholesale garden supplier.
- Dynamic inquiry on supplier
In this scenario, the garden retailer uses Web services to perform an inventory search of several wholesale suppliers.
- Cross supplier inquiry
In this scenario, the garden retailer makes its Web service available for use by others who need the service.
At present, these scenarios provide descriptions rather than step by step instructions. To gain experience with Web services coding, see the WebSphere Samples Gallery. It provides detailed instructions for building, configuring, and running the Plants by WebSphere sample application and others.
Before Web services
Suppose that the Plants by WebSphere storefront does not use Web services. The garden retailer has established an impressive Internet storefront enabling customers to shop and order merchandise. To determine whether a customer order can be filled, Web applications rely on enterprise beans to query the Plants by WebSphere inventory database. If the item is in stock, the site confirms the order to the customer.
If a customer orders an item that is out of stock, the site notifies the customer that the item is out of stock, and encourages the customer to place the item on backorder. Later, long after the customer has left the Plants by WebSphere site, the site administrator or inventory manager might call or fax the supplier to obtain more inventory.
Introducing Web services
Web services could give Plants by WebSphere an automated way to have out of stock items shipped to its warehouse or directly to customers. If suppliers can be contacted quickly enough, Plants by WebSphere does not have to inform its customers that the item was out of stock. Plants by WebSphere could begin to reduce its own inventory if doing so is a desirable business move.
Web services is built on the following core technologies:
- XML (Extensible Markup Language)
XML solves the problem of data independence. You use XML to describe data and to map that data into and out of any application or programming language.
To have their applications exchange information such as merchandise price and availability, Plants by WebSphere and its supplier places the data in a set of XML tags to which both parties agree.
- WSDL (Web Services Description Language)
You use this XML-based language to create a description of an underlying application. It is this description that turns an application into a Web service, by acting as the interface between the underlying application and other Web-enabled applications.
Plants by WebSphere has an application capable of querying the supplier inventory. To enable communication with the supplier over the Internet, the company turns the application into a Web service.
- SOAP
SOAP is the core communications protocol for the Web, and most Web services use this protocol to talk to each other.
SOAP is an XML format for Web services requests. According to the SOAP specification, SOAP is "a lightweight protocol for exchange of information in a decentralized, distributed environment." It is an XML-based protocol that consists of three parts: an envelope that defines a framework for describing what is in a message and how to process it, a set of encoding rules for expressing instances of application-defined data types, and a convention for representing remote procedure calls and responses. SOAP can potentially be used in combination with a variety of other protocols; however, the only bindings defined in this document describe how to use SOAP in combination with HTTP and HTTP Extension Framework.
Because they are external to the Plants by WebSphere intranet, communications with its suppliers utilize SOAP over HTTP. Web services operating within the company intranet can use other transports, such as local Java bindings. The Web Services Invocation Framework (WSIF) component described below can help Plants by WebSphere applications dynamically choose the optimal transport mechanism for a given situation.
- Web Services for J2EE specification
The Web Services for J2EE specification, also known as JSR-109, defines how J2EE applications create and access Web services.
- Java API for XML-based remote procedure call (JAX-RPC)
JAX-RPC, also known as JSR-101, defines how Java applications access Web services.
The WebSphere product line provides a wealth of additional specifications and standards to help you get the most out of your Web services. For a complete list of specifications and standards used in Web services, see the topic "Specifications and API documentation."
Sub-topics
Web services scenario: Static inquiry on supplier
Web services scenario: Dynamic inquiry on supplier
Web services scenario: Cross supplier inquiry
Related Reference
Specifications and API documentation
Related information
Samples page on IBM site