The flat file schema for Biztalk instances

Source: Internet
Author: User
Tags biztalk

Although XML files are becoming more and more popular, many computer systems still use flat files to store data. The so-called flat file is a concept that is relative to the XML data file. XML data files are a tree structure, and many files, such as DBF database files, are not tree-like structures, which we call flat files.

Some flat files have no obvious structure, or we do not care about its structure, and some require BizTalk processing of flat files, and we need to be clear about their structure. Biztalk Server provides a flat file schema for flat files that describes the structure of flat files. In the structure of technical flat files, some data are divided by location, and some data are separated by delimited characters. For example, the following flat file is used to store the user ID, user name, and password:

S01 Test 12345623
S02 Vvzz 778845
S03 FENGFF 4432
S04 Liudan 772432

In this file, the different records are separated by carriage return, and each field is determined by the location. The user ID and user name are very characters, and the user ID starts at the first character of the record, starting with the 11th character of the record, starting with the 21st character of the record.

If we need to use BizTalk to process this flat file, we will do the following:

1. Create a BizTalk Project
2. Create a flat File schema
3. Create a Receive pipeline
4. Create a business process
5. Deploy the project for testing


Here's a look at the steps:

One, create an empty BizTalk project

1. Open Visual Studio. Net 2003, create a new project, select the project type for the BizTalk project, the template is empty for the BizTalk Server Project, and enter the name Flatfile.

Second, create a flat file schema

2. Add a new item for the Flatfile project, select the schema, and enter the name Flatfileschema.xsd.

3. Select <schema> on the schema tree, click the "..." button after the Schema Editor extension in the Properties window, open the Schema Editor extension, check the flat file extension, and set the Allow premature termination property to Yes.

4. Rename the root to items, set the child delimiter type to 16, and set the child delimiter to 0x0D 0x0A, which indicates that the record is separated by a carriage return line.

5. Add a child record item to the items, set the structure to a position, Max occurs is *, indicate no limit, min occurs is set to 0, which means at least 0.

6. Add three sub-field elements for item, rename them to UserID, username, and password respectively, and set their location length property to 10.

Third, create a receive pipeline

7. Add a new item for the Flatfile project, select the Receive pipeline, and set the name to RECEIVEFLATFILEPIPELINE.BTP.

8. Drag and drop the flat file Disassembler from the Toolbox into the disassembly of the receive pipeline and set the document schema to Flatfile.flatfileschema.

Iv. Creating a business process

9. Add a new item for the Flatfile project, select the BizTalk Orchestration, and set the name to Flatfileorchestration.odx.

10. Create an Flatfilemessage message for the orchestration in the Orchestration view with a message type of Flatfile.flatfileschema.

11. Drag-and-drop the receive operation from the BizTalk Orchestration Toolbox into the orchestration, placing the send operation below the receive. Set their message property to Flatfilemessage, and set the name to Receiveflatfile and Sendxmlfile, respectively.

12. Place a port on the port surface, set the name to ReceivePort according to the Port Configuration Wizard, the port type name is Receiveporttype, the port traffic direction is always receive the message on this port, the port is specified as immediate; Set the transfer to file, set the URI to C :/in/*.txt, set the receive pipeline to Flatfile.receiveflatfilepipeline.

13. Place a port on the port surface, set the name SendPort, set the port type to Sendporttype, set the port communication direction to always send a message on this port, set the port binding to specify now, set the transfer to file, set the URI to c:/out/% Messageid%.xml, set the Send pipeline to Microsoft.BizTalk.DefaultPipelines.PassThruTransmit.

14. Connect the receive Port ReceivePort with the receiveflatfile operation and connect the SendPort to the Sendxmlfile.

15. Set the activation property of the Receiveflatfile operation to True.

V. Deploy the project for testing

16. Compile the project.

17. Select the Build/Configuration Manager menu and select the Deploy check box.

18. Select the Project/flatfile Properties menu to set common Properties, assemblies/assembly key files for the project. The creation of the key file is described in the Http://blog.csdn.net/fengfangfang/archive/2006/07/11/904725.aspx article.

19. Select the build/deploy solution.

20. Refresh the BizTalk Configuration database in BizTalk Explorer, and the Flatfile.flatfileorchestration node will appear under the orchestration to start the business process.

21. Save the above record as a test.txt file and put it in the C:/in folder. BizTalk will automatically output the XML file in the C:/out folder.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.