Integrating Integrators – BizTalk, Windows Azure, Windows Workflow, and Beyond
Join
Sign in
Search Options
Search Everything
Search BizTalk Blogs
Home
AppFabric
BizTalk Server
Windows Azure
Windows Workflow
Jobs (Hire A Guru)
More ...
Home
»
BizTalk Server
»
BizTalk Blogs
»
Stephen W. Thomas BizTalk MVP
»
Working with Untyped Send and Receive Ports in BizTalk Orchestrations
Working with Untyped Send and Receive Ports in BizTalk Orchestrations
BizTalk Blogs
This group is for blogs related to BizTalk Server. This includes Community Syndicated blogs and Stephen W. Thomas’s blog.
Get this RSS feed
Home
Blogs
Sitewide Application Navigation
Home
Blogs
Media
Forums
Wikis
Groups
Options
Share this
Monthly Archive List
Archives
May 2013
(1)
April 2013
(4)
March 2013
(1)
February 2013
(2)
December 2012
(1)
November 2012
(4)
October 2012
(6)
September 2012
(6)
July 2012
(1)
May 2012
(2)
April 2012
(1)
February 2012
(1)
January 2012
(1)
September 2011
(1)
August 2011
(3)
March 2011
(1)
February 2011
(2)
January 2011
(1)
December 2010
(1)
November 2010
(2)
October 2010
(4)
September 2010
(3)
August 2010
(2)
October 2009
(1)
June 2009
(1)
May 2009
(1)
April 2009
(5)
February 2009
(1)
January 2009
(1)
December 2008
(1)
November 2008
(4)
October 2008
(3)
September 2008
(1)
May 2008
(1)
April 2008
(2)
March 2008
(3)
February 2008
(3)
January 2008
(1)
December 2007
(3)
November 2007
(4)
October 2007
(2)
September 2007
(2)
July 2007
(1)
May 2007
(2)
April 2007
(1)
December 2006
(3)
November 2006
(2)
October 2006
(2)
September 2006
(5)
August 2006
(5)
July 2006
(5)
April 2006
(4)
March 2006
(4)
February 2006
(1)
January 2006
(2)
December 2005
(3)
November 2005
(3)
October 2005
(5)
September 2005
(9)
August 2005
(9)
July 2005
(7)
June 2005
(7)
May 2005
(1)
April 2005
(6)
March 2005
(3)
February 2005
(4)
January 2005
(3)
December 2004
(2)
November 2004
(3)
October 2004
(8)
September 2004
(5)
August 2004
(7)
July 2004
(4)
Tags
Applied Architecture Patterns on the Microsoft Platform
Azure
biztalk
biztalk 2004
biztalk 2006
BizTalk 2009
BizTalk 2013
biztalk book
biztalk errors
Biztalker
Book
Contest
convoy
debatching
deployment
flat files
maps
orchestration
pipelines
schema
testing
Virtual Machines
Window Azure
Windows Azure Virtual Machines
Workflow 4
Stephen W. Thomas BizTalk MVP
Insight and guidance on BizTalk, AppFabric, and related Microsoft technologies.
RSS for posts
Working with Untyped Send and Receive Ports in BizTalk Orchestrations
Rate This
Stephen W. Thomas
Tue, Aug 10 2004 2:20 PM
Comments
1
Scott posted a message back in
June
about untyped receive ports inside on Orchestration.
Untyped Messages means you receive or send a message as System.Xml.XmlDocument rather then a specific schema type.
This is an incredibly powerful feature in BizTalk 2004!
Business Case
:
Lets say you want to have one Orchestration (i.e. a single business process) to process many different types of messages all in the same way.
Additionally, say you want to change some values in your message and send all of your messages out through the same Send Shape (i.e. send messages as Xml.XmlDocument).
Lets say you can have a Book Review and a Movie Review.
You want them both to be processed in the same way though the same Orchestration, maybe send information to an outside web service or something like that.
Additionally, you have to extract out promoted properties of the message inside the Orchestration and make decisions inside the Orchestration on them.
This can not be done with Xml.XmlDocument since the Orchestration will not allow you to access them (they are in the message context, just you can not get at them).
Confused?
How about we look at a sample.
DOWNLOAD:
Get the sample here!
Set-up is easy, just unzip the SampleProperties folder and put it on your C: drive.
Then, build and deploy the SampleProperties project. I use early binding so the send and receive ports will be created for you.
To run the sample, drop the 4 Start….xml message into c:\SampleProperties\In.
You will get 4 messages in your Out folder.
Plus, 4 events will be written to your event log.
Do not forget to look inside the expressions shapes inside the Orchestration for comments.
If all else fails, read the ReadMe.txt file.
Key Take Home Points:
- Common properties must be promoted in all of the different schemas (look at the promotions in both BookReview.xsd and MovieReview.xsd)
- Messages for type XmlDocument can be cast into different types
- Typed messages can be cast back into XmlDocument
- Blank Schema can be created and properties changed (look at Movie Review branch)
- This is using Property Promotion and Demotion in the XML Pipelines
- As a test, set the Send Pipeline to Pass Through and see the difference in the Movie Review output data.
- This will also work for distinguished fields
CRITICAL:
This process is kind of risky since you can pass in any XML Document.
You can end up with an invalid cast exception or XPath query not valid.
What is this Movie Review Branch inside the Orchestration really doing?
Taking in a message of type Xml.XmlDocument
Casts the In message to CastMovieIn (strongly typed to a schema)
Sets Orchestration variables based on promoted properties inside the MovieReview schema
Creates a new XML Document (CastMovieOut) and loads a blank schema for that type
Changes values inside CastMovieOut
Creates a new message, Out, as XmlDocument
Casts the CastMoveOut to Out
Take Away:
Using XmlDocument can greatly increase the flexibility inside your Orchestration.
1 Comments
biztalk
,
biztalk 2004
,
xmldocument
,
untyped messages
Your comment has been posted.
Close
Thank you, your comment requires moderation so it may take a while to appear.
Close
Leave a Comment
Name
Website
Comment
Post
David
Wed, Oct 18 2006 8:40 AM
Wow! This site is very good! www.stanis.ru/zopa2004
http://stanis.ru/zopa2004/
Page 1 of 1 (1 items)