BizTalk Specifications

BizTalk Server is XML-centric underneath the hood. Every inbound document is parsed into its XML representation to make it easier to transform and then serialize it into its native outbound format. It uses the BizTalk Editor specification to parse and serialize the inbound and outbound documents. Simply put, a BizTalk specification is an XDR schema with XML annotations included. Just how many annotations are we talking about? Listing 4.1 displays an example of a bank transaction BizTalk XDR specification.

Listing 4.1. A BizTalk Server XDR Specification—Bank Transaction
<?xml version="1.0"?>
<!-- Generated by using BizTalk Editor on Sat, Nov 17 2001 01:23:11 PM -->
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<Schema name="Transaction" b:BizTalkServerEditorTool_Version="1.5" b
:root_reference="Transaction" b:standard="XML" xmlns="urn:schemas-microsoft-com:xml-data"
 xmlns:b="urn:schemas-microsoft-com:BizTalkServer" xmlns:d="urn:schemas-microsoft-com
:datatypes">
<b:SelectionFields/>

<ElementType name="Type" content="textOnly" model="closed" d:type="string">
<b:FieldInfo/>
</ElementType><ElementType name="Transaction" content="eltOnly" model="closed">
<b:RecordInfo/>
<element type="Amount" maxOccurs="1" minOccurs="0"/>
<element type="Type" maxOccurs="1" minOccurs="0"/>
<element type="Facility" maxOccurs="1" minOccurs="0"/>
<element type="Location" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Name" content="textOnly" model="closed" d:type="string">
<b:FieldInfo/>
</ElementType><ElementType name="Location" content="eltOnly" model="closed">
<b:RecordInfo/>
<element type="Name" maxOccurs="1" minOccurs="0"/>
<element type="Address" maxOccurs="1" minOccurs="0"/>
</ElementType><ElementType name="Facility" content="textOnly" model="closed"  d:type="string">
<b:FieldInfo/>
</ElementType><ElementType name="Amount" content="textOnly" model="closed" d:type="float">
<b:FieldInfo/>
</ElementType><ElementType name="Address" content="textOnly" model="closed"  d:type="string">
<b:FieldInfo/>
</ElementType></Schema>

The BizTalk specification, as you can see, has some BizTalk specific elements and attributes that need to be discussed. First, notice that a new namespace is defined by the URN xmlns:b="urn:schemas-microsoft-com:BizTalkServer". Any elements prefaced with a b:, therefore, are assumed to be BizTalk-specific.

The lines immediately following that give three new attributes: BizTalkServerEditorTool_Version, root_reference, and standard. The purpose of the BizTalkServerTool_Version attribute is to classify the BizTalk Editor version used to build the schema. This could be important for future upgrades of the application that might require a later version of the BizTalk specification, for example.

The root_reference property defines the document element of this XML instance—in other words, the top element in this XML document, the element that encapsulates all the other data. In this case, the document element is <Transactions>. The standard attribute declares the format that is going to be used to express the data. In this instance, XML is used as the formatting type.

In addition to the attributes described previously, several elements are added to a traditional XDR schema. They are SelectionFields, RecordInfo, and FieldInfo. Because we are describing an XML document, the elements are empty; however, other formatting standards, such as comma-delimited files, require the data in these elements. The BizTalk Editor handles the annotation of the XDR schemas for us automatically requiring developers to have little or no knowledge of XDR or the supported BizTalk annotations. As a result, the remainder of the chapter focuses on the creation of the specifications using BizTalk Editor as opposed to physical characteristics of the XDR specifications created by the Editor.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset