Blogging BizTalk

Lets Discuss BizTalk

Working with FLAT files in BizTalk


In this example I will demonstrate how we can use BizTalk capabilities to work with flat files. One thing which is different about flat file when compared to xml files is, it doesn’t have a namespace hence the subscription for these kind of messages is handled in a unique way by BizTalk. However please note once inside the Biztalk server every thing is purely XML, doesn’t matter what format source system did send the message in FLAT, EDI, HL7 ..etc.

So in this example we have an inbound flat file and a receive port will pick it up and from there it will be subscribed by a send port to route it to our desired destination, like all of my previous examples I will be using file type adapter, this will allow users to implement the solution easily.

Step1> Create a new BizTalk project. Add a new schema and use the “Define Record From Flat File instance” to create your schema, I will share the project files soon in case anyone wants to reuse them. We are going to have 2 schemas one for inbound message and other for outbound. We will also use a simple map to concatenate some of the values in the inbound map and create the output message.

FlatfileInstanceDefine

Step2>Add a Receive Pipeline and in the drag a “Flat file disassembler” to the disassemble block. In the properties of the Flat file disassembler set your inbound schema against Document Schema property.

RcvPipelineFlat

The purpose of creating this pipeline component is to use it in the Receive port, when the flat files arrives this pipeline component converts it to XML format for internal usage of BizTalk engine. Note: It not necessary to set the Document schema property, you can also set the DocumentSpecName property manually post deploying in the receive  port. In case you set the Document schema property in your visual studio solution after deploying pipeline the DocumentSpecName will be automatically set.

DocumentSpecName

step3>Create a map which will convert the inbound message to outbound format. I have used a simple map. We are going to use this map at our send port.

Flatfilemap

Note: We can use an orchestration as well to use this map and implement the same scenario, please refer my previous post : Content Based Routing Using An Orchestration with DirectBound Port

Step 4>Create a send pipeline and at the assemble stage drag the Flat File Assembler control from toolbox.Set up the Document Schema property to your outbound message type. This pipeline component will convert the xml back to flat file format for output.

SendPipelineFlat

Step 6>Deploy your visual studio solution

Step 7>Create your physical receive a send port.For receive port in the receive pipeline use your custom pipeline. Same way for send port the send pipeline used should be your custom send pipeline. Also in send port use the map we have created in the solution.

SendPipelineflatPhy RcvPipelinePhysical

Step 8>Start all your ports and restart HIS.

Our solution is ready, when you drop a flat file to your receive location BizTalk should pick it and give you a flat file output at you send location in the outbound message format.

Please let me know if there are any questions.

Need source code, please drop a comment with your email id and I will revert back ASAP.

Advertisements

6 responses to “Working with FLAT files in BizTalk

  1. Ravish November 24, 2013 at 1:53 am

    Nice article, thanks for sharing

  2. kranti February 20, 2014 at 2:01 pm

    Nice one… pls share me the source code.

  3. Pushpendra Singh February 20, 2014 at 3:16 pm

    Hi Kranti,

    Will inbox it soon.

    Thanks
    Singh

  4. saurabh October 9, 2014 at 12:22 pm

    nice kindly send source code

  5. Pushpendra Singh October 9, 2014 at 1:46 pm

    Hi Saurabh,

    In boxed it, check your gmail please.

  6. Upendar January 22, 2017 at 7:08 am

    Good one, Its very helpful for me.

    pls share me source code

    Thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

D Goins Insperience

Technological outformation for this day and age

[INACTIVE BLOG] Connected Thoughts - Thiago Almeida

Connected systems and the occasional picture

Uri Katsir's Blog

BizTalk , BizTalk RFID and .NET

prashantbiztalkblogs

My BizTalk Experiences

BizTalk Server Tutorial

BizTalk Server Concepts and Common Errors

Extremely Talented Monkeys

A Technical Blog by Ed Jones: Azure, .NET, BizTalk, WCF, and SQL Server

On All Things Web

Discussing web development without limits

Vikas Bhardwaj's Blog

Articles about BizTalk Server and .NET C#

Cloud develop

a blog about (cloud) development... because I'm a nerd

Hooking Stuffs Together

My learning logs from day to day work experience about Integration platform using Microsoft technologies.

Connected Pawns

Mainly BizTalk & Little Chess

jhelatissimo

a blogger in the process.

MS Innovations Blog

Tips, Tricks, and Workarounds for BizTalk and other Microsoft technologies

srirambiztalks

Katradhu Kaialavu,Kalladhadhu Ulagalavu!

Vijay Microsoft Technical

BizTalk, WCF, ESB ToolKit, Windows Azure

Mind Over Messaging

Musings on BizTalk, Azure, WCF, and Enterprise Integration

%d bloggers like this: