This sample demonstrates how to use 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 the 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 Transform 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 an  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 your development environment in trusted root certification authority.

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

Test the Solution

  • 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 Azure BizTalk Services 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 here: Use Azure Biztalk Service to transform flat file to XML

See Also

For documentation on BizTalk Services see Azure BizTalk Services documentation.

Another important place to find a huge amount of Azure BizTalk Services related articles is the TechNet Wiki itself. The best entry point is
Azure BizTalk Services resources on the TechNet Wiki.

If you are also looking for BizTalk Server related articles, the best entry point is
BizTalk Server Resources on the TechNet Wiki.