Step 3: Generate the Schema for the Flat File Message
Important
Microsoft Azure BizTalk Services (MABS) is being retired, and replaced with Azure Logic Apps. If you currently use MABS, then Move from BizTalk Services to Logic Appsprovides some guidance on moving your integration solutions to Logic Apps.
If you're brand new to Logic Apps, then we suggest getting started here:
-
Create your first logic app, or quickly get started using a pre-built template
-
View all the available connectors you can use in your logic apps
As described in the business scenario, Northwind Traders sends a flat file message to Humongous Insurance. For Humongous Insurance, to process the message by using a one-way bridge, it must have the schema of the flat file message as part of the BizTalk Service project created in the last step. BizTalk Services provides a Flat File Schema Wizard that generates a flat-file schema from an existing flat-file instance message. Humongous Insurance uses the flat-file message instance message that it received from Northwind Traders (out of band, over e-mail) and then uses the Flat File Schema Wizard to create the schema.
Assume that the flat file message (SampleInsuranceClaim.txt) that is sent to Humongous Insurance, looks like the following:
101|HI|1000.0|John;RedmondWay;Seattle;Washington|1234567
This topic demonstrates how to use the Flat File Schema wizard to generate a flat file schema by using SampleInsuranceClaim.txt as the input instance message. The sample file is also provided with the solution (FlatFile_Bridge_Integration) available as a download from https://go.microsoft.com/fwlink/?LinkID=249449.
To use the Flat File Schema wizard
Right-click the FlatFile_Bridge project, point to Add, and then click New Item.
In the Add New Item dialog box, select Generate Flat File Schema, enter a name for the schema as InsuranceClaim.xsd, and then click Add. The Flat File Schema Wizard starts.
On the Flat File Schema Information screen, select your instance and enter the following information. When you are done, click Next to continue.
Instance file: Click the Browse button to locate the flat file from which the schema will be generated. Browse to the folder that contains the text file you created in the Prerequisites section.
Record name: Type SourceClaim. The value you specify here is the schema root name.
Target namespace: Accept the default, https://FlatFile_Bridge.InsuranceClaim for schema target namespace.
On the Select Document Data screen, the contents of the flat file are displayed. Select the data needed for creating the schema, and then click Next. In this walkthrough, because we are using the entire document instance, you can press Ctrl-A to select all.
In the Select Record Format screen, you specify whether the records are formatted using a delimiter symbol or by defining relative positions. In the instance message we chose, the records are delimited using a pipe symbol (|), hence select By delimiter symbol, and then click Next.
On the Delimited Record screen, enter the following to define the first level of the schema and when you are done, click Next.
Child delimiter: Select |.
Escape character: An escape character is a single character that suppresses any special meaning of the character that follows it. See Escape Characters for more information. For this walkthrough, leave this blank.
Note
When using \, {, and } for Child delimiter or Escape character, a back slash must be used. For example, \\, and \{.
Click Next to continue.
The wizard identifies five elements in the SourceClaim record. Enter values for the elements as illustrated in the following table to define the elements under SourceClaim record:
Element Name
Element Type
Data Type
Enter ClaimID
Select Field Element.
Select positiveInteger
Enter ClaimType
Select FieldElement
Select string
Enter ClaimAmount
Select FieldElement
Select double
Enter PersonInfo
Select Record
Enter PolicyId
Select FieldElement
Select string
Click Next to continue.
Note
After you click Next on the Child Elements screen, you will not be able to click Back to redefine or make any changes to the child elements. For any changes, restart the wizard to define the flat file schema.
After you complete the steps until here, the first level of the schema is generated as shown in the Schema View page.
Because we defined PersonInfo as a Record type, the Flat File Schema Wizard now continues to further define the PersonInfo record. On the Schema View page, select PersonInfo, and then click Next to continue.
On the Select Document Data page, select the segment that corresponds to the PersonInfo record, as shown in the image below, and then click Next to define its child elements.
On the Select Record Format page, select By delimiter symbol, and then click Next. Choose this option because the elements within the PersonInfo record are delimited using a symbol, semicolon (;).
On the Delimited Record page, enter the following to define the PersonalInfo record. When you are done, click Next.
Select ; from Child delimiter drop-down selection list.
Leave the Escape character text box blank.
Using the values from the Delimited Record page, the wizard identifies four child elements. Provide values for the record elements as suggested in the following table.
Element Name
Element Type
Data Type
Enter Name
Select Field Element.
Select string
Enter Address
Select FieldElement
Select string
Enter City
Select FieldElement
Select string
Enter State
Select FieldElement
Select string
You have defined all the nodes for the SourceClaim schema. On the Schema View page, click Finish.
After you click Finish, the schema file you created, InsuranceClaim.xsd, is opened within the Visual Studio solution. You can now verify the schema that you created.
See Also
Tutorial: Using BizTalk Service Bridges to Lookup Data from Azure SQL Database