The last piece of the puzzle for me in working with generic messages to do away with a TON of duplication is to dynamically call a rules policy to validate outbound EDI messages.
This is some sample code I found on the blog mentioned above:
sCon = “Initial Catalog=Northwind;Data Source=(local);Integrated Security=SSPI;”;
con = new System.Data.SqlClient.SqlConnection(sCon);
dcNorthwind = new Microsoft.RuleEngine.DataConnection(“Northwind”, “ShipperCountry”, con);
xmlDocument = msgShippingRequest;
typedXmlDocument = new Microsoft.RuleEngine.TypedXmlDocument(“RoleLinkSample.ShippingRequest”,xmlDocument);
policy = new Microsoft.RuleEngine.Policy(“ShippingPolicy”);
msgOutgoingShippingRequest = typedXmlDocument.Document;
typedXmlDocument = null;
dcNorthwind = null;
This sample is based on Biztalk 2004, but should not differ in this instance for Biztalk 2006.