Thursday, 23 January 2014

Use Windows Azure Biztalk Service (WABS) to transform flat file to XML


This sample demonstrates how to use Windows Azure Service Bus to transform flat file to XML. The XML Bridge receives the flat file, transforms and sends it to Azure Service Bus Queue.
Use Message Receiver to retrieve messages from Queue.

Step by Step

Create BizTalk Service Project.


Create FlatFile Schema using FlatFile Schema Wizard.


If you create flatfile schema then you need to set structure and Delimiter properties manually.


Create XML Schema .


Create Map . 

Do Mapping as per required.

Double click on MessageFlowItinerary.bcs and configure the message flow.
Add XMLOneWayBridge.
Add queue
Use Connector to connect Bridge with Queue.

Double click on XMLOneWayBridge and configure Message Type to FlatFile Schema.

Configure Tranform stage of XMLOneWayBridge using Map

Configure Queue. 

Create XMLQueue on Azure Service Bus.
Configure Authentication properties

Configure MessageFlowInternary , Set BiztalkServiceURL

Right Click on Project and Deploy.
Set Acs NameSpace, IssuerName and Secret Key.

You can get this information from Azure Portal

If While Deployment you will get Error
“The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel”
Then Do the following Steps:
Go to  Azure Portal -> Biztalk Service DashBoard
Download SSL Certificate 

Install this certificate to you development environment in trusted root certification authority.

After Deployment you can check at Azure Portal, Schemas and Map deployed.


Set the following code in MessageSender Project 
string acsNamespace = "NameSpace";
string issuerName = "owner";
string issuerKey = "<Secret Key>";
string runtimeAddress = https://< ;NameSpace>";
string messageFilePath = @"<Sample File Path>";
string contentType = "text/plain";

Run the Message Sender Project.

You can check Messages from tracking tab on WABS Portal.

Read Message From XML Queue.
Set the ConnectionString and Run MessagingWithQueue Sample, Download ,
<add key="Microsoft.ServiceBus.ConnectionString" value="<ConnectionString Copy from portal>" />

Source Code

Download Source code from msdn code Gallery

No comments:

Post a Comment