BizTalk : BTS.MessageType not promoted

I was working on a project the other day pushing around untyped messages.  When I say untyped the orchestration ports are using the type System.Xml.XmlDocuemnt.  I wrote a custom pipeline component to dynamically pre-pend processing instructions to the outbound xml based on mesage type.  When I went to lookup the messageType context property I found it wasn’t set, which makes sense. 
After a bit of looking around I found others had solutions that didn’t really suit my needs.  e.g. one solution was to expose properties on the pipeline component and set the properties at design time, and another was to load the entire document into memory using System.Xml.XmlDocument.  Neither approach sat well with me so I ended up taking a streaming approach using XmlTextReader to stream through the IBaseMessage.BodyPart.GetOriginalDataStream.
This entry was posted in BizTalk Server. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s