Step 2: Generate the Schema for the Flat-file Message
As described in the business scenario, Fabrikam will send a flat file message to Contoso. For Contoso, to process the message using the bridge, it will need to have the schema of the flat file message added to the BizTalk Services solution. BizTalk Services provides a Flat File Schema Wizard that generates a flat-file schema using an existing flat-file instance message. Contoso will use the flat-file message instance message that it received from Fabrikam (out of band, over e-mail or through another medium) and then use the Flat File Schema Wizard to create the schema. For instructions on how to use the wizard, see How to Use the Flat File Schema Wizard.
For this tutorial, let us assume that a flat-file message (ORDERS.txt) is sent to Contoso. Contoso uses the Flat File Schema Wizard and generates the PO.xsd flat-file message schema. Both the instance message as well as the message schema are provided here.
Flat-file instance message (ORDERS.txt)
Ord123|Item201;20;50|Item202;100;20
Schema for PO.xsd
<?xml version="1.0" encoding="utf-16" ?>
<xs:schema xmlns="http://Windows.Azure.ServiceBus.EAI.Samples.ExploringFeatures.FlatFileProcessing.PO1" xmlns:b="http://schemas.microsoft.com/BizTalk/2003" targetNamespace="http://Windows.Azure.ServiceBus.EAI.Samples.ExploringFeatures.FlatFileProcessing.PO1" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:annotation>
<xs:appinfo>
<b:schemaInfo standard="Flat File" root_reference="PurchaseOrder" default_pad_char="" pad_char_type="char" count_positions_by_byte="false" parser_optimization="speed" lookahead_depth="3" suppress_empty_nodes="false" generate_empty_nodes="true" allow_early_termination="false" early_terminate_optional_fields="false" allow_message_breakup_of_infix_root="false" compile_parse_tables="false" />
<schemaEditorExtension:schemaInfo namespaceAlias="b" extensionClass="Microsoft.BizTalk.FlatFileExtension.FlatFileExtension" standardName="Flat File" xmlns:schemaEditorExtension="http://schemas.microsoft.com/BizTalk/2003/SchemaEditorExtensions" />
</xs:appinfo>
</xs:annotation>
<xs:element name="PurchaseOrder">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="Order">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="char" child_delimiter="|" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="OrderId" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" maxOccurs="unbounded" name="OrderDetails">
<xs:annotation>
<xs:appinfo>
<b:recordInfo structure="delimited" preserve_delimiter_for_empty_data="true" suppress_trailing_delimiters="false" child_delimiter_type="char" child_delimiter=";" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:annotation>
<xs:appinfo>
<b:groupInfo sequence_number="0" />
</xs:appinfo>
</xs:annotation>
<xs:element name="ProductId" type="xs:string">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="1" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="UnitPrice" type="xs:positiveInteger">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="2" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="Quantity" type="xs:positiveInteger">
<xs:annotation>
<xs:appinfo>
<b:fieldInfo justification="left" sequence_number="3" />
</xs:appinfo>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
See Also
© 2013 Microsoft Corporation. All rights reserved.