[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ]

Note that several fields from the source are mapped to multiple fields in the destination document. Many of the name and address fields for instance are mapped to the “ShippingAddress” as well as to the “BillingAddress” in the destination. This is necessary, because the source document doesn’t differentiate between those addresses, yet we need them in the target document.

Also, not all the fields are straight maps. Some of them use so-called “Functoids”. Those are the little boxes you see in the center of the map. The one to the top is a data functiod. The target document requires a date to be defined, but the source document doesn’t indicate one, so we use the date functiod to insert the current date. Right beneath we see a mathematical functiod. It is used to sum the values of “itemtotal” from the source and put it into the header record (there can be multiple items defined in the source document). Another mathematical functiod is used below to apply a rebate to the item price, according to our business agreement with West Wind Technologies. Right beneath you see 4 script functoids that use VBScript to retrieve some more advanced values.

The number of available functoids is large and ranges from simple string manipulation and mathematical functions to scientific calculations and even scripts.

Finished maps are stored to a WebDAV repository or the local hard drive where they can be referenced from BizTalk Server (Management Desk).

WebDAV

WebDAV is an extension to the HTTP Protocol, which allows users to collaboratively edit and manage files on remote web servers. WebDAV stands for “Web-based Distributed Authoring and Versioning”. WebDAV provides standard ways to handle issues such as locking and access control (although the later is still work in progress).

WebDAV is an open standard that is used by many companies such as Netscape, Novell, Xerox, Microsoft and more. Microsoft Office 2000 represents one of the most popular implementations of the WebDAV standard for Office Collaboration.

Microsoft BizTalk Server 2000 uses WebDAV for authoring document definitions and maps (although you can also save these documents on your hard drive without using WebDAV).

For more information on WebDAV visit www.WebDAV.org.

Distribution Lists

Distribution Lists allow routing messages to several organizations at once. This is useful to distribute information such as price lists or catalogs. Regular ports always map to one and only one organization (that is true even if the destination is open in which case a single organization is determined during runtime). A Distribution List is linked to an infinite number of ports that will receive the routed message. All those ports need to have a specified destination (no open ports are allowed) because messages routed to Distribution Lists cannot have routing information for all destinations (if they did, this mechanism would be very inflexible…).

A Distribution List is linked to a Channel, just like Ports are usually linked to Channels. Only this time, the Distribution List spreads the information to a number of Ports.

Envelopes

Using envelopes, routing information can be attached to documents and document formats that are lacking that information.Envelopes represent header and footer information attached to the main document.

Submitting Documents

Now that we have basic know-how about BizTalk Server and its most important components, features and tools, it is time to submit our first document. For a start, we will do so using Visual FoxPro code.

Manual Routing through BizTalk’s COM Interface

Communication with BizTalk is handled through a COM based interface. Submitting Documents is simple. Let’s assume we want to route an order document that originated at West Wind Technologies into BizTalk so we can process the order. Here’s an example document West Wind Technologies submits to EPS:

    <?xml version="1.0"?>
    <westwindstore>
       <itemsold>
          <invoicenumber>098324</invoicenumber>
          <name>Markus Egger</name>
          <company>EPS Software Corp.</company>
          <address><![CDATA[13810 Champion Forest Dr.
                  Suite 202
                  Houston, TX 77069
              ]]></address>
          <shipping/>
          <email>megger@eps-software.com</email>
          <phone>(281) 866 7444</phone>
          <sku>OOBOOK</sku>
          <descript>Advanced Object Oriented Programming</descript>
          <qty>1</qty>
          <price>49.95</price>
          <itemtotal>49.95</itemtotal>
       </itemsold>
    </westwindstore>

I created a test form we can use to submit the document. Here it is:

The form is rather simple. It provides an editbox where we can define the document that’s to be submitted (I simply pasted the message from above). When the “Post to BizTalk Server” button is clicked, the following code is executed:

    LOCAL loBT AS BizTalk.Interchange
    LOCAL lvResult
     
    loBT = CREATEOBJECT("BizTalk.Interchange")
    lvResult = loBT.Submit(1,THISFORM.Edit1.Value,;
               "West Wind Store Order",;
               "Organization Name","West Wind Technologies",;
               "Organization Name","Home Organization")

As you can see, the code is simple and straightforward. We create an instance of the BizTalk.Interchange object, and call the Submit() method, passing in the content of the editbox (our order document).

In this example, we are performing a manual route, which means that we pass information about the document format as well as the source and destination organization. Parameter 3 specified the document type (which has to be set up in the BizTalk Management Desk). Parameters 4 and 5 specify the organization identifier (Name, DUNS Number, …) and the actual name. Parameters 6 and 7 do the same for the destination organization.

Assuming the document was valid according to the schema we set up, BizTalk Server will find a Channel/ Port pair that matches the document type as well as the defined organizations. According to our configuration, the Channel will convert the document into the format used at EPS and hand it over to the appropriate Port. The Port will then route the document to the target address, which is a file named C:\TestOrder.XML. Here’s an example of that file:

    <EPSPurchaseBid>
       <PBHeader TradingPartnerAgreement="WestWind" BidDate="2000-09-08"
         BidNumber="098324" BidTotal="199">
          <BillingAddress>
             <Name>Markus Egger</Name>
             <Company>EPS Software Corp.</Company>
             <Address>13810 Champion Forest Dr.
                       Suite 202
                       Houston, TX 77069
                    </Address>
             <EMail>megger@eps-software.com</EMail>
             <Phone>(281) 866 7444</Phone>
          </BillingAddress>
          <ShippingAddress>
             <Name>Markus Egger</Name>
             <Company>EPS Software Corp.</Company>
             <Address>13810 Champion Forest Dr.
                       Suite 202
                       Houston, TX 77069
                    </Address>
             <EMail>megger@eps-software.com</EMail>
             <Phone>(281) 866 7444</Phone>
          </ShippingAddress>
       </PBHeader>
       <Items SKU="OOBOOK" BidPrice="199" Quantity="1">
          <ItemName> Advanced Object Oriented Programming</ItemName>
          <ShipmentOption PhysicalShipment="no"
               DownloadNotification="yes" ShippingFee="0"/>
       </Items>
    </EPSPurchaseBid>

Great! We successfully routed our first document.

It didn’t work? OK, in that case, there may be a number of reasons. First of all, the routing process may take a couple of seconds if the service has to start up. If nothing happens after a couple of seconds, make sure the BizTalk Routing Service is started. You can check that in the BizTalk Administration interface:

[ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ]