JAX and Web Services: The Great Car Parts Company Scenario

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

Java APIs for XML Kick Start
By Aoyon Chowdhury, Parag Choudhary

Table of Contents
Chapter 2.  Components of Web Services


JAX and Web Services: The Great Car Parts Company Scenario

Let's now look at how the Great Car Parts Company can leverage the Web services environment and the Java APIs for XML to meet its business needs.

Recall that the Great Car Parts Company has decided to add mobile phone chargers to the list of items it sells. To buy the chargers, it discovers wholesalers for chargers, gets their price lists, decides on the best bid, and places procurement orders.

In the Web services scenario, Jack, the procurement person, asks the company's information services team to design and develop a procurement application for him. The information services team decides to use Java and JAX to develop the procurement application.

This is how the procurement application works:

  1. The application uses JAXR to send a query to the UDDI registry to find wholesalers for chargers.

  2. The UDDI registry receives the request and applies the search criteria specified in the JAXR code.

  3. The result, containing the list of wholesalers, is sent back to the client as a SOAP message.

  4. Using the results of the query, the application uses JAXM to request price lists from the different companies.

  5. Upon receiving the request, the wholesalers do a JAX-RPC on the manufacturer's Web service to find out about stock availability and possible price fluctuations.

  6. Based on the response to the JAX-RPC, the wholesalers respond back to Great Car Parts Company's requesting application with the prices in an XML document.

  7. The application uses JAXP to parse the price lists and decide on the company that quotes the lowest price as the chief supplier.

  8. The application creates an XML-based order form containing the number of mobile phone chargers it wants to buy.

  9. A JAXM message is created, and the order form is attached to it. This JAXM message is then sent to the company, which acknowledges the receipt of the order via JAXM.

Now that the procurement part has been taken care of, the Great Car Parts Company has to update its Web site to reflect the new item, as well as the selling price. To do so, a combination of JSP and JAXP is used. The JSP page uses JAXP to get the price information from the lowest bidder's XML price sheet, raises the figure by 20%, then displays the price as an HTML page.


printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
Top

[0672324342/ch02lev1sec5]

 
 


JavaT APIs for XML Kick Start
JAX: Java APIs for XML Kick Start
ISBN: 0672324342
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net