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"