Thursday, November 10, 2011

Mostly immutable

I have had the "pleasure" of working with BizTalk on a few projects now.

I will save my general impression of Biztalk for another post. This is just to mention a undocumented side effect in BizTalk.

One of the key things in BizTalk is that all messages are immutable. I have found this to be mostly true.

In the following Message_1 and Message_2 are messages and should be immutable (except for in the block that constructs them)

Variable_1 = Message_1;
XmlSplitter.GetSFPage(Variable_1,0,2);
Message_2 = new System.Xml.XmlDocument();
Message_2.LoadXml(Message_1.OuterXml);



Message_1 is constructed elsewhere and yet we are able to change it by loading it into an XmlDocument. the above code is XLANG and I think it's a bug that the first line of code does not clone the message.