<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>BizTalk lessons from the field : Pipelines</title><link>http://blogs.msdn.com/nabeelp/archive/tags/Pipelines/default.aspx</link><description>Tags: Pipelines</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Sending an HTML Email without an Orchestration</title><link>http://blogs.msdn.com/nabeelp/archive/2008/09/11/sending-an-html-email-without-an-orchestration.aspx</link><pubDate>Thu, 11 Sep 2008 15:44:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8944547</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/8944547.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=8944547</wfw:commentRss><description>There is plenty of information on the Net relating to being able to send an HTML email from BizTalk using a dynamic SMTP port and an orchestration (see here and here ).&amp;#160; At a client I needed to achieve the same objective, but without the use of an...(&lt;a href="http://blogs.msdn.com/nabeelp/archive/2008/09/11/sending-an-html-email-without-an-orchestration.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8944547" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/Adapters/default.aspx">Adapters</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/Pipelines/default.aspx">Pipelines</category></item><item><title>Challenge: Execute a Map and Return the Result, WITHOUT an Orchestration</title><link>http://blogs.msdn.com/nabeelp/archive/2008/06/16/challenge-execute-a-map-and-return-the-result-without-an-orchestration.aspx</link><pubDate>Mon, 16 Jun 2008 19:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8605974</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/8605974.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=8605974</wfw:commentRss><description>The Issue Earlier this week Bennie Wentzel , a developer from a customer I was engaged with last year, posed me a question which went something like this: If I have a synchronous web service receive port, how can I return the result of a map on this receive...(&lt;a href="http://blogs.msdn.com/nabeelp/archive/2008/06/16/challenge-execute-a-map-and-return-the-result-without-an-orchestration.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8605974" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/Pipelines/default.aspx">Pipelines</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/MessageBox/default.aspx">MessageBox</category></item><item><title>XMLValidatingReceive Pipeline Clarification</title><link>http://blogs.msdn.com/nabeelp/archive/2008/05/22/xmlvalidatingreceive-pipeline-clarification.aspx</link><pubDate>Thu, 22 May 2008 10:38:23 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8531446</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/8531446.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=8531446</wfw:commentRss><description>&lt;p&gt;In my &lt;a href="http://blogs.msdn.com/nabeelp/archive/2008/05/14/biztalk-does-not-validate-my-message.aspx"&gt;previous post&lt;/a&gt; on the default behaviour of the XMLReceive pipeline with respect to validating a message against a schema I detailed the creation of what I termed the &amp;quot;XMLValidatingReceive Pipeline&amp;quot;.&amp;#160; In response to this posting, Payal Arya emailed me the following question with respect to this posting, which highlighted the need for more clarity around how the pipeline works: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&amp;quot;Your posting was very helpful, however I had one question that what's the use of XML Disassembler and Party Resolution in the Pipeline, when only XML validator solves the purpose.&amp;quot;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;After getting this question, and reading through my post again I clearly did not detail the reasoning for the use of these components, so here goes.&lt;/p&gt;  &lt;p&gt;The reason why I kept the &lt;em&gt;XML Disassembler&lt;/em&gt; and &lt;em&gt;Party Resolution&lt;/em&gt; components in the pipeline is that I wanted the standard XML Receive pipeline to be enhanced with an automatic schema validation function.&amp;#160; This would then provide me with an enhanced, generic pipeline I would be able to use in any development that required schema validation.&amp;#160; This required that I keep the same functionality that the XMLReceive pipeline provided, and just extend its functionality: so that the XMLValidatingReceive pipeline effectively becomes an evolution of the XML Receive pipeline's generic functionality.&lt;/p&gt;  &lt;p&gt;The alternative, if you wanted the simplest pipeline that would still do schema resolution and validation, would be to create a pipeline that just has the &lt;em&gt;Xml Validator&lt;/em&gt; component in the pipeline.&amp;#160; As the &lt;em&gt;Xml Validator&lt;/em&gt; component will automatically resolve the schema from the message's target namespace and root node name, it would be able to identify the schema associated with the received message, and then perform the validation as well.&lt;/p&gt;  &lt;p&gt;By keeping the &lt;em&gt;XML Disassembler&lt;/em&gt; component in the pipeline, however, the pipeline will still support any envelope and debatching processes embedded in the schema design, and the debatched messages would then be validated by the&lt;em&gt; Xml Validator&lt;/em&gt; component. Similarly, by including the &lt;em&gt;Party Resolution&lt;/em&gt; component, any party resolution logic that you may require in your solution is still supported. Obviously, if you do not require either of these functions in your solution and you do not want to incur the overhead of these additional components you could exclude these pipeline components, and your pipeline would still perform the validation function.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8531446" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/Pipelines/default.aspx">Pipelines</category></item><item><title>BizTalk Does Not Validate My Message?!?!</title><link>http://blogs.msdn.com/nabeelp/archive/2008/05/14/biztalk-does-not-validate-my-message.aspx</link><pubDate>Wed, 14 May 2008 22:40:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8504298</guid><dc:creator>Nabeel Prior</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/nabeelp/comments/8504298.aspx</comments><wfw:commentRss>http://blogs.msdn.com/nabeelp/commentrss.aspx?PostID=8504298</wfw:commentRss><description>&lt;p&gt;The ability to rigidly define the content of a data field is an essential element in any structured data definition.&amp;#160; It is no surprise therefore one can define data constraints on elements and attributes in a schema through the means of various facets, such as enumerations, min length, regular expressions, and many more.&amp;#160; The implementation of facets in a schema provides a large amount of value in terms of the data aspect of the contract to be used in an integration.&amp;#160; Whether the integration is WCF-based or not, this data contract must be adhered to and messages that do not adhere to this contract must not be processed.&lt;/p&gt;  &lt;p&gt;There is, however, no value in defining the data constraints if these constraints can not be enforced at the time the data is received, as allowing &amp;quot;invalid&amp;quot; data to be processed will invariably lead to errors in the processing of that data.&amp;#160; It is for this reason that validating a message against its schema is oftentimes a necessary requirement.&amp;#160; Some might say that this validation should be performed by default, and any messages that do not validate should be rejected as early in the processing of the message as possible.&amp;#160; BizTalk does not do this by default.&lt;/p&gt;  &lt;p&gt;At this point you may be saying what do you mean &amp;quot;BizTalk does not validate my message?&amp;quot; ... hence, the title of this post.&lt;/p&gt;  &lt;p&gt;The point is that &lt;strong&gt;BizTalk &lt;em&gt;CAN &lt;/em&gt;validate your message, but it does not do so by default&lt;/strong&gt;.&amp;#160; One of the reasons for this is flexibility: you may prefer to do the validation later in your process, perhaps in an orchestration, where you can handle the validation errors in your own way; or you may want the receive pipeline to do the validation and have BizTalk route the failed message.&amp;#160; This decision is not made for you by BizTalk ... your solution design will determine the appropriate implementation.&lt;/p&gt;  &lt;p&gt;In this post I will present two ways in which you can get BizTalk to fully validate your message against its schema as early in the receiving process as possible: at the receive pipeline.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Using the XMLReceive Pipeline&lt;/h1&gt;  &lt;p&gt;When using the standard XMLReceive pipeline in a receive location you can click on the ellipsis button to the right of the pipeline selection box to display the &amp;quot;Configure Pipeline&amp;quot; window.&amp;#160; The screenshot below shows how the XMLReceive pipeline makes use of the &lt;em&gt;XML disassembler&lt;/em&gt; pipeline component and the &lt;em&gt;Party resolution&lt;/em&gt; pipeline component.&amp;#160; When first setting up the receive location the &lt;strong&gt;ValidateDocument&lt;/strong&gt; and &lt;strong&gt;DocumentSpecNames&lt;/strong&gt; properties are &lt;strong&gt;False &lt;/strong&gt;and &lt;strong&gt;blank &lt;/strong&gt;respectively.&amp;#160; In this default configuration the XMLReceive pipeline will try and match the received XML document's target namespace and root node name to the published schemas in BizTalk, and the received document's structure will be validated against the schema's structure.&amp;#160; No data validation is performed on the received document, however.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/XMLReceive_4.png" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="514" alt="XMLReceive" src="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/XMLReceive_thumb_1.png" width="699" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;By setting the &lt;strong&gt;ValidateDocument&lt;/strong&gt; property to &lt;strong&gt;True&lt;/strong&gt; the &lt;em&gt;XML disassembler&lt;/em&gt; pipeline component will be instructed to validate the data contained in the received document as well.&amp;#160; Setting this property to true also requires that at least one &lt;strong&gt;DocumentSpecName&lt;/strong&gt; is also provided, as the &lt;em&gt;XML disassembler&lt;/em&gt; uses the schema specified by the fully qualified assembly name in the &lt;strong&gt;DocumentSpecNames&lt;/strong&gt; property to identify the schema with which to perform the validation.&amp;#160; With these properties set, if the receive location processes a message that fails validation an entry like the one below will be logged to the event log.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/ErrorMessage2_2.jpg" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="448" alt="ErrorMessage2" src="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/ErrorMessage2_thumb.jpg" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;While this approach achieves the objective it falls short for an ideal solution, because:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The &lt;em&gt;XML disassembler&lt;/em&gt; pipeline component has logic built into it to identify the matching schema for a received message, so why does it not use this schema to perform validation?&amp;#160; In other words, I would like to be able to change the &lt;strong&gt;Validate&lt;/strong&gt; flag to true, without needing to specify a value for the &lt;strong&gt;DocumentSpecNames&lt;/strong&gt; property. &lt;/li&gt;    &lt;li&gt;Every time the schema changes (possibly due to version changes) the developer will need to remember to go and change the configuration of the XMLReceive pipeline to ensure that the correct fully qualified assembly name is stored in the &lt;strong&gt;DocumentSpecNames&lt;/strong&gt; property. &lt;/li&gt;    &lt;li&gt;If I have multiple receive locations that each need to do schema validation the previous task would be compounded as I would need to remember to set the properties for each receive location. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;This leads on to the second method to ensure that BizTalk validates the content of the received message: a custom pipeline that can be used in any receive location to do full schema validation, without requiring any additional configuration.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Creating and Using the XMLValidatingReceive Pipeline&lt;/h1&gt;  &lt;p&gt;The concept behind the XMLValidatingReceive pipeline is to have a generic pipeline that one can use in any project, and in any receive location where the received document's structure and data content needs to be validated against an existing schema.&amp;#160; As the standard functionality of matching a received document with a deployed schema is still required, the XMLReceive pipeline is an excellent starting point.&amp;#160; As the XMLReceive pipeline uses the &lt;em&gt;XML disassembler&lt;/em&gt; and &lt;em&gt;Party resolution&lt;/em&gt; pipeline components, the XMLValidatingReceive pipeline will need to use these two pipeline components as a starting point as well.&amp;#160; In addition to these components, the XMLValidatingReceive pipeline will also make use if the &lt;em&gt;XML validator&lt;/em&gt; pipeline component.&lt;/p&gt;  &lt;p&gt;To create the XMLValidatingReceive pipeline, create a new receive pipeline.&amp;#160; I created this pipeline in a generic BizTalk solution and project, so that I could use it for any solution, at any customer.&amp;#160; In the new receive pipeline, add the &lt;em&gt;XML disassembler&lt;/em&gt;, &lt;em&gt;XML validator&lt;/em&gt; and &lt;em&gt;Party resolution&lt;/em&gt; pipeline components, as per the screenshot below.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/pipeline_4.jpg" target="_blank"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="552" alt="pipeline" src="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/pipeline_thumb_1.jpg" width="225" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There is no need to change any of the default properties for any of these components.&amp;#160; The pipeline can now be deployed and used in any BizTalk application.&amp;#160; A message processed by this pipeline will now use the &lt;em&gt;XML disassembler's &lt;/em&gt;schema resolution functionality and it will validate the structure of the document against the resolved schema.&amp;#160; The &lt;em&gt;XML validator &lt;/em&gt;component will then use the resolved schema name to validate the received document's data content, in accordance with any facets defined in the schema.&amp;#160; Where a received document fails validation, the same error as in the previous method is shown (as below), except that the pipeline referred to will now be the new custom pipeline.&lt;/p&gt;  &lt;p align="center"&gt;&lt;a href="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/ErrorMessage1_2.jpg" target="_blank"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="448" alt="ErrorMessage1" src="http://blogs.msdn.com/blogfiles/nabeelp/WindowsLiveWriter/ValidatingMessagesInAReceivePipeline_CE4B/ErrorMessage1_thumb.jpg" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The result is a common pipeline that can be used in any receive location, and which does not require any configuration of pipeline properties to ensure that the received document is full validated.&amp;#160; At the same time, this pipeline does not require any changes to be effected in the event of a change to a schema.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Summary&lt;/h1&gt;  &lt;p&gt;In conclusion, don't assume that BizTalk will enforce those facets you diligently applied to your schema.&amp;#160; You need to instruct BizTalk to validate a received message against the data constraints you define in your schema, and there are two simple ways in which this can be achieved.&amp;#160; If it is a regular requirement to ensure that the received document is fully validated against the schema, then create a custom XMLValidatingReceive pipeline that can be used in any BizTalk development project.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8504298" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/nabeelp/archive/tags/BizTalk/default.aspx">BizTalk</category><category domain="http://blogs.msdn.com/nabeelp/archive/tags/Pipelines/default.aspx">Pipelines</category></item></channel></rss>