Step by Step guide of setting up an EDI in BizTalk Server 2013

What is an EDI

EDI – Electronic Data Interchange is an electronic communication medium that is use to exchange documents between different trading partners. EDI have specific text file format followed with specific version and document Id. For example, the Warehouse shipping order document is termed as 940 EDI document.

Why do company prefer EDI to exchange documents?

There are many benefits. Computer to computer exchange is much less expensive, cost is a primary reason, as it’s a standard every business understands and parse the documents easily.

Role of BizTalk Server

BizTalk server is a powerful server side product developed by Microsoft that is used for integrating distributed systems or applications. It acts as a middle hub where the businesses can submit documents and the destination client can get it in his specific format. It works on the publisher/subscriber model in which the client can subscribe to the incoming messages and the publisher publishes it to that port. On the other hand if you need to tweak some attributes of the document or to transform the inputted document into the client’s specific format can be done using mapping or pipeline.

Scenario

In this article I will give the complete step by step in sending 940 EDI document and converting it to the client’s specific XML format, and placing it to the destination folder.

  1. Open Visual Studio 2012. (With BizTalk 2013 you can create BizTalk projects using VS 2012)
  2. Create a new empty BizTalk project

     

     

  3. Specify name and click OK.
  4. As we have to process EDI 940 document we need to add its schema
  5. Right click the project and add existing schema from C:\Program Files (x86)\Microsoft BizTalk Server 2013\XSD_Schema\EDI

     

     

  6. Now create another schema which you wanted to send to the destination client.

     

     

  7. Now add some child elements into the schema as shown below

     

     

  8. Now add a map to provide mapping between the 940 schema file to our custom created schema file.

     

  9. Once this is added, we can see screen like this

     

     

  10. Now click on the Open Source schema and select 940 schema document

     

     

  11. Now click on the Open destination schema and select client specific one we recently created

     

  12. For demo only, I am mapping ST01 with OrderNo and ST02 with CompanyCode

     

 

  1. Save the project and build it.
  2. Before deploying sign the assembly from project properties signing tab

     

  3. Go to the deployment tab and select Restart host Instances to True and specify the Application Name

     

  4. Rebuild and deploy the solution, you will see the application added under the Applications
  5. Go to the BizTalk administrative console and you can see the application added in the Applications tab
  6. Now create a receive port where you will submit the EDI 940 text file.

    Right click the Receive Ports and click add New -> One way receive port

     

     

  7. In order to process EDI document we have add a reference to BizTalk EDI Application
  8. Right click the application and click properties
  9. Go to the references tab
  10. Add application reference as BizTalk EDI Application

     

     

  11. Click on the Receive Locations and add new receive location by hitting the New button
  12. Specify Receive location name as RecieveLocation
  13. Select Type as File as we will be putting the EDI txt file on particular folder
  14. Click configure to select the path and other attributes
  15. Specify the receive folder and select file mask as *.txt
  16. I have specified C:\demo\in as folder path where I will put EDI txt files

     

  17. Now add a send port where the file after processing by BizTalk will be send.

     

     

  18. In the SendPort window select TYPE as file and configure the path where the document will be placed after processing from BizTalk. I have selected file extension as .xml as I will be sending the custom formatter xml on the folder.
  19. Select send pipeline as XMLTransmit
  20. Add Outbound Maps and select the map you have created above.

     

  21. Specify Filter to process only those messages that have specific attributes.
  22. Here I will select BTS.RecievePortName = “RecievePort”

     

  23. Click Ok

     

     

Running Solution

Now when you place the EDI text file at C:\Demo\In folder it will be picked, transformed into client specific xml format and placed it into the C:\Demo\out folder by BizTalk Server.

Output file format looks like below

<?xml version=”1.0″ encoding=”utf-8″?><ns0:DemoData xmlns:ns0=”http://DemoPrj.clientspecific”><OrderNo>94A</OrderNo><CompanyCode>0001</CompanyCode></ns0:DemoData&gt;

 

Hope this helps to those who are new to BizTalk and EDI implementations.

Advertisements

One thought on “Step by Step guide of setting up an EDI in BizTalk Server 2013

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