Passing Messages to Components In BizTalk

Link. March 21, 2004. Comments [0]. Posted in: BizTalk
If you're calling .NET components from BizTalk Server 2004 orchestrations, then chances are sooner or later you'll want to pass in complete messages as arguments. Doing it is actually pretty easy.

One way to do this is to get your component to accept an XmlDocument instance. This works right away because ultimately, the BizTalk message is just an XmlDocument instance with a lot of goo on top, and so BizTalk knows hows to convert right away from and to an XmlDocument.

However, you might actually want more control over this. So, one way to work things is to have your components accept an instance of Microsoft.XLANGs.BaseTypes.XLANGPart, as it has a few useful methods and properties. For example, you can access the document's schema thorugh the XmlSchema property.

One pretty useful method in XLANGPart is the RetriveAs() method, which allows you to get a copy of the message into a representation you can deal with. Obviously, XML related types work right away (XmlNode, XmlDocument, and a few others, but not XmlReader), but you can specify any other type that is Xml-Serialization-compatible with the message schema.



Comments are closed.

Syndicate

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Ads


Links

Categories

Statistics

Total Posts: 1024
This Year: 94
This Month: 1
This Week: 2
Comments: 795

Blogroll

Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.1.8139.823

Sign In