Click to return to the XML (Extensible Markup Language) home page    
Web Workshop  |  XML (Extensible Markup Language)

Creating a Multi-Supplier System with XML


August 11, 1998

The Business Problem
The Role of XML
Solving the Problem with Allaire ColdFusion
   Situation Overview
   User Scenario
   Behind the Curtain
XML Example

The Business Problem

The Whackmeister lawn mower company has been buying about 10,000 wing nuts per week from the same supplier for ten years. But since bringing two more factories online, it has found that its regular supplier is unable to provide the additional 6,000 wing nuts it needs to fill the new capacity. To make matters worse, the factories were built to meet projected demand from Whackmeister's ambitious expansion plans, which means there's no money available to re-architect the automatic purchasing and tracking system or to hire new personnel to process orders by hand. Thus the company now has to design a flexible system that will allow it to work with multiple suppliers without increasing the overhead associated with ordering parts.

TopBack to top

The Role of XML

XML acts as a universal data format to describe each day's price and available inventory of wing nuts from each of Whackmeister's many suppliers. Because the XML vocabulary contains a predictable set of known elements, Whackmeister needs no information about any of the supplier's backend systems except the URL for the latest quote. This URL might be to a static catalog or it could pass a database query to the supplier's back-end system if it is using a dynamic page-generation system like ColdFusion or Active Server Pages.

The Whackmeister XML scenario demonstrates how XML can be used as the lingua franca for structured data within a particular industry or group of related businesses even if they make no arrangements to coordinate their systems ahead of time. This makes it possible for the Internet to act as a conduit for complex business transactions without requiring complex, time-consuming, and expensive re-engineering of information systems. It also brings the same level of flexibility in commerce that the Web brought in the presentation of information to unknown users.

TopBack to top

Solving the Problem with Allaire ColdFusion

Situation Overview

With ColdFusion from Allaire (http://www.allaire.com/ Non-MS link), Purchasing Manager Joe Smith can prototype, test, and deploy a simple application that polls multiple suppliers' XML-based Web catalogs and aggregates each of their pricing and inventory quotes automatically into a single Web page from which he can place orders directly. The orders can then be passed into Whackmeister's internal order-tracking database to fulfill each factory's needs as they arise. Joe's system saves the day. He gets a big raise and lives happily ever after.

TopBack to top

User Scenario

Joe Smith, purchasing manager for Whackmeister, receives a daily report of orders for Whackmeister's 3200 series, high-powered industrial lawn mowers. The 3200 series uses M8 metric wing nuts in zinc-coated steel. These usually sell for between $6 and $9 per 100-count box. The purchasing page lists the latest price and available units from a set of suppliers. Joe can sort this list according to the needs of the moment: If price is critical, he can sort suppliers by price so the least expensive supplier is easiest to find. If volume is more important than price, he can sort by that criteria to find the cheapest supplier able to meet his needs at that moment.

When Joe has made his choice, he clicks on the company name, which is a link to a purchase order. The PO is a form in which all of the appropriate information for Whackmeister has been supplied automatically: the company's account number, Joe, as the contact, preferred shipping methods, etc. Joe picks the appropriate Whackmeister factory from a drop-down list, which fills out the shipping address on the form, and enters the volume of wing nuts he wants to buy. He submits the form, and it is automatically translated into the supplier's automated purchase order format and passed to the supplier's system.

TopBack to top

Behind the Curtain

Alternative approaches:

Automating the processing of Supplier Quotes: ColdFusion can use any COM object using the CFObject tag. Using the MSXML control that ships with Internet Explorer, ColdFusion can parse the XML quotes from each supplier. Using the Scheduler and criteria set by Joe ahead of time to choose lowest price with appropriate volume, the purchasing system could automatically place orders with the correct supplier.

Transforming Data Structures Between Different Application Server Architectures: In a forthcoming Allaire technology initiative the ColdFusion Application Server will be able to pass data between different server architectures along with information about its structure and type. This will allow it to be translated into the appropriate data structures by another server (which could be a ColdFusion server or another platform such as ASP) or by a browser. In that case each supplier's system would serialize its price quotes into a common exchange format that included type information. This could be deserialized on the server as ColdFusion recordset objects or by the browser as JavaScript objects. When sending the purchase order information back to a supplier, the data would go through a similar transformation. The advantage is that the need to settle on a common XML vocabulary ahead of time is eliminated, increasing Whackmeister's flexibility in choosing suppliers.

TopBack to top

XML Example

A sample of the Supplier quote extracted hourly by ColdFusion Application Server via HTTP:

<QUOTE>

<PRODUCT>M8 metric wing nut, steel, zinc</PRODUCT>
<PRICE>$7</PRICE>
<AVAILABLE>2000</AVAILABLE>
</QUOTE>

CF App Server's tag-based scripting language is used to add the company name and date around the XML quote snippet. A sample of the XML file that merges multiple quotes from multiple suppliers with company and date/time information to create the master file used by the client-side application:

[create whole file]
<ALLQUOTES>
   <QUOTE>
      <COMPANY ID=17>House of Hardware</COMPANY>
      <DATE>May 6, 1998, 9:00</DATE>
      <PRODUCT>M8 metric wing nut, steel, zinc</PRODUCT>
      <PRICE>$7</PRICE>
      <AVAILABLE>2000</AVAILABLE>
   </QUOTE>
   <QUOTE>
      <COMPANY ID=23>Nutz 'N Such</COMPANY>
      <DATE>May 6, 1998, 9:02<DATE>
      <PRODUCT>M8 metric nut, steel, zinc</PRODUCT>
      <PRICE>$6</PRICE>
      <AVAILABLE>1500</AVAILABLE>
   </QUOTE>
   <QUOTE>
      <COMPANY ID=27>Hardware Haven</COMPANY>
      <DATE> May 6, 1998, 9:04<DATE>
      <PRODUCT>M8 metric nut, steel, zinc</PRODUCT>
      <PRICE>$4.50</PRICE>
      <AVAILABLE>500</AVAILABLE>
   </QUOTE>
</ALLQUOTES>



Back to topBack to top

Did you find this material useful? Gripes? Compliments? Suggestions for other articles? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.