Aug 072008

I needed a quick reference for EDI Data Types, abortion so here it is.

AN Alpha Numeric String
B Binary Number
FS Fixed-Length String
ID Identifier, from a pre-defined list of applicable code values
Nn Numeric, with (n) implied decimal places
R Decimal Number (Real Number)
TM Time (HHMMSS), 24-hour clock

Aug 072008

It seems as though every orchestration I’m trying to xpath something either into or out of a message in BizTalk.  So I’m creating a simple cheat sheet that I can refer to.

To set a single value inside a message:

xpath(msg_YourMessage, “Node Instance XPath”) = str_YourValue;

To extract a single value from a Message:

str_YourValue = (System.String)xpath(msg_YourMessage,”string(Node Instance XPath)”);

Note: I like casting the xpath result to a System.String so I can have complete access to all the System.String methods/properties inside of the Expression Shape

Extract a single value from a looping segment by index:

str_Xpath= System.String.Format(“Node Instance XPath[{0}]”,int_Index);

xDoc = xpath(msg_YourMessage, str_Xpath);

Count the number of nodes inside the message:

int_NumberofNodes = System.Convert.ToInt32(xpath(msg_YourMessage, “count(Node Instance Xpath)”));