Thursday, 30 January 2014

Using Windows Azure Biztalk Service to receive EDI file from multiple partner



Introduction

This sample demonstrates how to use Windows Azure Biztalk Service (WABS) to receive EDI file , transform EDI  to XML. The EDI Bridge receives the EDI 832 file, transforms and sends it to Azure Service Bus Queue.
Use Message Receiver to retrieve messages from the Queue.

Business Scenario

Fabrikam, Northridge and Contoso are three business partners. Fabrikam and Northridge (the supplier) sends product catalog messages to Contoso (the retailer) in EDI format. Contoso maintains all the product catalog data in xml format within Contoso’s premises. Fabrikam and Northridge send EDI 832 messages to Contoso. Hence, Contoso has to implement a solution on Windows Azure, which enables the following: Contoso must expose end point from where it receive EDI 832 files from Fabrikam and Northridge
Contoso must process EDI 832, validates and transformed to XML format

To enable this scenario, Contoso does the following:

Create EDI and XML Schema, Mapping between EDI and XML.
Create and configure trading partner setup for Fabrikam, Northridge and Contoso
Create Queue on Azure service bus to store XML.


Step By Step.

Create Biztalk Services Artifacts Project in visual studio 2012.

 
Delete Default Map and Schema (Schema1, Schema2 and Map).
Add EDI 832 schema. (Download MicrosoftEDIxsdTemplate from msdn )
Create xml schema for price sales catalog.

Create Map.

Go to WABS portal and upload schema and Map.


Upload Map













Create 3 partners on the portal

 











Click on Save.
Similarly you can create profile for contoso and fabrikam.
Create agreements between
  • contoso and fabrikam
  • contoso and Northridge

Steps to create agreement between contoso and fabrikam.
Click on Agreements ->New.


Add partner name and Click on continue.
Select the transport type over which contoso want to receive EDI 832.
I am using transport type as HTTP for demo purpose.

















Select Schema in the protocol section  














Select Map in the transport section
Now in the route section set routing settings.













Click on add to add routing actions
















Set Service bus namespace, Issuer Name, Issuer Key and Queue Name.

 












Similarly do the send setting.
 












In Similar way we can create agreement for contoso and Northridge
After created two agreements, you can check 4 bridges deployed on portal 















Agreement/1/Receive – to receive EDI from fabrikam
Agreement/2/Receive – to receive EDI from Northridge
Agreement/1/Send-to sends EDI from contoso
Agreement/2/Send- to send EDI from contoso

Test the solution.

Download Biztalk Service Explorer.














Connect to your Biztalk services.
Using Biztalk services explorer to send EDI message to EDI bridges.














After send EDI message to bridge, you can check in tracking whether message is routed to success Queue or Error Queue.

 












if message is routed to success queue, then you can download XML from SuccessQueue
Read Message From SuccessQueue 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 Here

Thursday, 23 January 2014

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

Introduction

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>.biztalk.windows.net/default/XmlOneWayBridge1";
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

Tuesday, 14 January 2014

How to create VM - Biztalk Server 2013 on windows azure with few clicks


This article gives an overview of how to create Biztalk Server 2013 VM on Windows Azure.



This article describes how to create Biztalk Server VM on Windows Azure.
When complete, you have a BizTalk Server available and ready to be configured using an existing SQL Server virtual machine in Windows Azure. Internet Information Services (IIS) and MS Distributed Transaction Coordinator (MSDTC) are also installed and ready to use.
 

 1: Go to Azure portal.
















Click on Virtual Machines Tab.
















Click on CREATE A VIRTUAL MACHINE


















In the taskbar at the bottom, click New, click Virtual Machine, and then click From Gallery.
 
















Select Biztalk Server 2013 Enterprise (Select Option as per required).
BizTalk Server 2013 Evaluation
A virtual machine that includes the following:
  • BizTalk Server 2013 Evaluation Edition
  • SQL Server 2012 Evaluation Edition
  • All requirements, including Internet Information Services (IIS) and MS Distributed Transaction Coordinator (MSDTC)
BizTalk Server 2013 Standard

A virtual machine that includes the following:
  • BizTalk Server 2013 Standard Edition
  • All requirements, including Internet Information Services (IIS) and MS Distributed Transaction Coordinator (MSDTC)
SQL Server and Visual Studio are not installed on this virtual machine.
BizTalk Server 2013 Enterprise
A virtual machine that includes the following:
  • BizTalk Server 2013 Enterprise Edition
  • All requirements, including Internet Information Services (IIS) and MS Distributed Transaction Coordinator (MSDTC)
SQL Server and Visual Studio are not installed on this virtual machine.
 

















Enter the name of the virtual machine
Enter a user name. This user name is the local Administrator on the virtual machine
Enter the Administrator password.
Re-enter the Administrator password.
Select the virtual machine size that fits your needs.


 





 Wait for some time, to successfully create VM.
Click on CONNECT.it will allow you to download RDP file.
Download RDP file and connect it using rdp file.

Biztalk Server 2013 Machine is ready to configure