Create a Business Document for the partner

When an order is received from the customer, it is transmitted by fax to the appropriate restaurant that prepares the dishes. In this example company, the restaurant orders software is an application that drives a fax machine. This application fills in computer-based forms with the data it receives, and then submits the resulting form to a fax machine for transmission using the phone line.

As a result, the XML document accepted by this application as an input requires three kind of information:

  • A fax number - Which is not part of the fax document because it is directly transmitted to the fax driver.
  • Sender and recipient information - Which is used to fill in the caption of the fax document.
  • Raw text - Which includes the details of the order and that constitutes the body of the final fax document.

The following XML file is an example of input for the restaurant orders software that must be extracted from the XML input of the sales web server:

<?xml version="1.0" encoding="ISO-8859-1"?>

<order>

<fax>202-659-5012</fax>

<caption>

<sender>

<name>Instant TakeOut</name>

<phone>202-978-0502</phone>

<fax>202-978-0502</fax>

</sender>

<recipient>

<name>Bombay Club Restaurant</name>

<phone>202-659-5052</phone>

<fax>202-659-5012</fax>

</recipient>

<orderid>20070310450</orderid>

</caption>

<body>

      2 x calamari peri peri

      2 x masala crab cake

      1 x tandoori mixed grill

      1 x lamb biryani

      5 x naan

      1 x Chardonnay Shale Ridge

   </body>

</order>

The sender is your Instant TakeOut company and the recipient is the appropriate restaurant. The whole order is included in the text body, without prices, but including quantities. This body section is in the form of raw text, with each order item on separate lines.

Repeat the procedure for creating a Business Document, but this time name it BD_orderToPartner. Define the structure of the Business Document as shown in following graphic:

Business Document structure

Related Links