Wednesday, 19 December 2012

Dynamic Mapping - Biztalk



For this exercise, I am building an orchestration which identifies the Company   and loads the corresponding map and sends the message to the intended recipient after the desired transformation. For this example, I have two Company  A and B.Orchestration identifies company based on ID .
Then transform message dynamically .

Step 1:Create Input Schema OrderDetails.Xsd

Input Schema





















Step 2:Create Two Destination Schema CompanyA_Order.xsd and CompanyB_Order.xsd












Step 3:Create Two Map for Company A and B ,

  • OrderDetails_CompanyAOrder.btm and 
  • OrderDetails_CompanyBOrder.btm





 




 




Step 4:Create Orchestration for Dynamic Mapping 

Expression Used for Dynamic Mapping 

ExpressionShape
if(Message_1(Company.Demo.DynamicMapping.PropertySchema.Id)=="A")
{
MapType = System.Type.GetType("Company.Demo.DynamicMapping.OrderDetails_CompanyAOrder,Company.Demo.DynamicMapping, Version=1.0.0.0, Culture=neutral,PublicKeyToken=884e2210690b4615");
}
else
{
MapType = System.Type.GetType("Company.Demo.DynamicMapping.OrderDetails_CompanyBOrder,Company.Demo.DynamicMapping, Version=1.0.0.0, Culture=neutral,PublicKeyToken=884e2210690b4615");
}

MessageAssignMentShape

transform (Message_2) = MapType(Message_1);







Tuesday, 18 December 2012

Avoid End of new line character from flat file Schema-Biztalk



Create Schema for FlatFile

Header1,Header2,Header3
Detail1,Details2,Details3
Detail1,Details2,Details3
Detail1,Details2,Details3
Detail1,Details2,Details3

Schema.xsd

















If this schema validates file like
Header1,Header2,Header3{cr}{lf}
Detail1,Details2,Details3{cr}{lf}
Detail1,Details2,Details3{cr}{lf}
Detail1,Details2,Details3{cr}{lf}
Detail1,Details2,Details3{cr}{lf}













Then go to properties of RootNode File.
Change child Order from PostFix To InFix

Wednesday, 12 December 2012

Change encoding from UTF-8 to ISO-8859-1 of Biztalk XML Message

From:  <?xml version="1.0" encoding="UTF-8" ?>
To:      <?xml version="1.0" encoding="ISO-8859-1" ?>

Solution:
While Create Message in Biztalk set TargetCharset to "ISO-8859-1"

Message(XMLNorm.TargetCharset) = "ISO-8859-1"

Tuesday, 16 October 2012

First Cloud Application using azure service bus




1-Create Enterprise Application Integration Project ,Say Project Name HelloWorld

2- Add New Item à Schema -RecordRequest.xsd


3- Add New Item à RecordResponse


4 - Create Map for Tranformation
5 - Add New Itemà Map


6-Create BridgeConfigurtion .
7- Drag XML-OneWayBridge
8- Change the properties of XML-OneWayBridge


9-Drag Queue
10-Connect Xml –Bridge with Queue
11-Configure the service NameSpace of BridgeConfigurtion







13- Use MessageReceiver And MessageSender Utility for send and receive Message from Queue.

MessageReceiver.exe  <Your namespace> <Issuer name> <Your issuer key>  <Queue name>  Create

MessageReceiver.exe  <Your namespace> <Issuer name> <Your issuer key>  <Queue name>  Listen

MessageSender.exe  mySBNamespace  owner  mySBNamespaceKey http://sbNamespace/<BridgeName>   Instance1.xml   application/xml

14- Deploy Application on Service Bus.





URL for Azure Portal:https://portal.appfabriclabs.com/Default.aspx
Run The Application 
Send Xml Message to Bridge:
Sample XML : <ns0:RecordRequest xmlns:ns0="http://HelloWorld.Artifacts.RecordRequest">
  <FirstName>FirstName</FirstName>
  <LastName>LastName</LastName>
  <EmpId>EmpId</EmpId>
  <AddressLine1>AddressLine1</AddressLine1>
  </ns0:RecordRequest>

Run Command :
MessageSender.exe  <ServiceBusNameSpace> owner  <Key> http://sbNamespace/<BridgeName>   Instance1.xml   application/xml

OutPut :
MessageReceiver.exe  <Your namespace> <Issuer name> <Your issuer key>  <Queue1>  Listen