<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Bram Veldhoen</title>
        <link>http://geekswithblogs.net/BVeldhoen/Default.aspx</link>
        <description>C#, .NET, WCF, BizTalk</description>
        <language>en-US</language>
        <copyright>Bram Veldhoen</copyright>
        <managingEditor>b.veldhoen@gmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>Bram Veldhoen</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/BVeldhoen/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Debatching, aggregation and resequencing using the BizTalk ESB Toolkit 2.0 and ESB.Extensions</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2009/09/11/debatching-aggregation-and-resequencing-using-the-esb.extensions.aspx</link>
            <description>&lt;p&gt;The ESB.Extensions framework is out!! You can &lt;a href="http://esbextensions.codeplex.com/"&gt;download it here&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;The ESB.Extensions builds on top of the ESB Toolkit 2.0, and thus requires BizTalk Server 2009. The ESB.Extensions contains a number of services, that are itinerary-aware: ReceivePipelineService, SendPipelineService, ResequencerService and ResequencerGoService. Let's look at them more closely.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The ReceivePipelineService&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When the ReceivePipelineService executes, the following steps are performed:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Receives a message.&lt;/li&gt;
    &lt;li&gt;Uses the resolution framework to resolve the receive pipeline type.&lt;/li&gt;
    &lt;li&gt;Executes the receive pipeline.&lt;/li&gt;
    &lt;li&gt;[Optional] If the pipeline didn't set these properties, assigns BatchId and SequenceId promoted properties to the pipeline output message(s).&lt;/li&gt;
    &lt;li&gt;[Optional] If the resolution (resolutionDictionary) included a new itinerary for the pipeline output message, this new itinerary is applied to the pipeline output message(s), and the original itinerary is reserved for further processing of the original (inbound) message. If no itinerary was specified during the resolution, it is assumed that the pipeline output message(s) should continue the itinerary of the original message, and processing of the original message is discontinued.&lt;/li&gt;
    &lt;li&gt;Publishes the pipeline output messages.&lt;/li&gt;
    &lt;li&gt;[Optional] If a new itinerary was specified for the pipeline output message(s) during resolution, advances the itinerary of the original message and publishes the original inbound message (if it had outstanding itinerary steps).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The following drawing depicts an itinerary, which I have titled "OneWay-Debatch-MessageSendPort" (ODM) that uses the ReceivePipelineService:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="145" height="416" src="/images/geekswithblogs_net/BVeldhoen/ESB.Extensions/ODM.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Fairly simple scenario, you send an order batch through an itinerary onramp to BizTalk, where the ReceivePipelineService orchestration will pick it up, debatch it using the receive pipeline, and forwards the order items to the Message SendPort. (i.e. bound to a FILE location).&lt;/p&gt;
&lt;p&gt;Debatching is one obvious application for the ReceivePipelineService, but you can specify any receive pipeline type in the resolver, so it can also be a 1:1 scenario where the pipeline has only 1 output message. I'm fairly certain that it will not work with FFDisAsm pipelines, though!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The SendPipelineService&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;When the SendPipelineService executes, the following steps are performed:&lt;/p&gt;
&lt;ol&gt;
    &lt;li&gt;Receives the 1&lt;sup&gt;st&lt;/sup&gt; message within the batch of messages to be executed by the send pipeline. After receipt of this 1st message, a convoy subscription is created based on the Itinerary (should point to SendPipelineService) and the BatchId.&lt;/li&gt;
    &lt;li&gt;Resolves the SendPipelineServiceResolution object, necessary to perform the execution of the send pipeline. This resolution object contains the following parameters:
    &lt;ul&gt;
        &lt;li&gt;&lt;font face=""&gt;Send pipeline type: the type of the send pipeline to execute.&lt;/font&gt;&lt;/li&gt;
        &lt;li&gt;&lt;font face=""&gt;XLANGMessageComparer type: The SendPipelineService uses a serializable list to collect the messages to be aggregated. You can specify the comparer type to control how the messages are sorted. This happens in memory, but does not add much overhead compared to the use of Microsoft.XLANGs.Pipeline.SendPipelineInputMessages. I used an XLANGMessage comparer that compares the messages's SequenceId promoted property values.&lt;/font&gt;&lt;/li&gt;
        &lt;li&gt;&lt;font face=""&gt;Batch Timeout: The timeout to apply to the entire batch. When this timeout expires, all the collected messages up to that point in time will be aggregated and the service completes.&lt;/font&gt;&lt;/li&gt;
        &lt;li&gt;&lt;font face=""&gt;Message Timeout: The timeout to apply to each message. When this timeout expires, all the collected messages up to that point in time will be aggregated and the service completes. &lt;/font&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;/li&gt;
    &lt;li&gt;[Optional] If a new itinerary was specified during resolution, the new itinerary will be applied to the pipeline output message, and the original inbound message will continue it's own itinerary. If no new itinerary was specified, it is assumed that the original inbound message's itinerary should be applied to the aggregated message. So, if a new itinerary was specified, the original message's itinerary is advanced and applied to the original message, and the original message is republished for further processing.&lt;/li&gt;
    &lt;li&gt;The inbound message is added to a list of pipeline input messages.&lt;/li&gt;
    &lt;li&gt;The receive loop (batch convoy) starts.&lt;/li&gt;
    &lt;li&gt;The next message within the batch is received and added to the list of pipeline input messages.&lt;/li&gt;
    &lt;li&gt;[Optional] Like in step 3, if necessary, the original message's itinerary is advanced and the message republished.&lt;/li&gt;
    &lt;li&gt;When all messages have been received (or when a Batch or Message Timeout has occurred), the receive loop (and the corresponding batch convoy) is ended.&lt;/li&gt;
    &lt;li&gt;The pipeline input messages are sorted using the XLANGMessageComparer type, specified in the resolver.&lt;/li&gt;
    &lt;li&gt;The itinerary (new or original advanced) is applied to the pipeline output message, and the message is published.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Below a scenario that uses both the ReceivePipelineService and the SendPipelineService:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="145" height="536" src="/images/geekswithblogs_net/BVeldhoen/ESB.Extensions/ODAM.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;An orderbatch gets sent through an itinerary onramp, gets debatched by the ReceivePipelineService. The resolver does not specify a new itinerary, so the original message's itinerary is used for the debatched messages. The debatched messages all have the same BatchId, and have a current itinerary step that points to the SendPipelineService, so they get picked up by the SendPipelineService. The SendPipelineService sorts and aggregates the messages, and publishes one output message, which is sent to the offramp.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The Resequencer and ResequencerGo services&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The idea for these services actually came from a TechEd (2006?) session, where Lee Graber detailed the use of the (what he called) Go-pattern to implement a resequencer. The Resequencer and ResequencerGo services work together to resequence any given sequence of messages. The ResequencerService blocks processing of a certain message until it receives the corresponding Go message (by using a parallel convoy). The ResequencerGoService's responsibility is to work out which message within the sequence is up next and publishes the corresponding Go message.&lt;/p&gt;
&lt;p&gt;The ESB.Extension implementation let's the resolver decide which message is up next, so the resolver (i.e. BRE) could access a database or any other (in-memory?) representation of the message sequence (or batch) to determine who's next. In my BizUnit tests I have used the simplest possible scenario, where the maximum number of messages is always 5 and the next SequenceId is simple determined by incrementing by 1.&lt;/p&gt;
&lt;p&gt;Below a scenario that uses the debatcher, aggregator and resequencer services:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="399" height="536" src="/images/geekswithblogs_net/BVeldhoen/ESB.Extensions/ODRAM.jpg" /&gt; &lt;/p&gt;
&lt;p&gt;In this scenario, the orderbatch gets debatched, every order item gets picked up by a seperate Sequencer instance. The 1st Go message, corresponding to the 1st message (SequenceId == 0) is sent to BizTalk, triggering the 1st Resequencer to release the 1st message. That message gets picked up by the SendPipelineService, and the SendPipelineService stores the pipeline input message, then itinerary-advances and republishes the original message, which triggers the ResequencerGoService to increment to the next SequenceId and publish the corresponding Go message. This process repeates until all messages have been processed (the ResequencerGo's resolution works out when it is the last message and does not publish a new Go message when it is the last). The SendPipelineService aggregates the message, applies the itinerary and ships it off to the offramp.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A select number of scenarios has been described here, and these are also the scenarios that have been tested. But there can be many many other scenarios, ranging from likely to not-in-a-million-years, that could be implemented with these services:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Receiving incoming messages for a certain interval (24 hours?), then sort and aggregate them and sending them off.&lt;/li&gt;
    &lt;li&gt;Debatching, sending the seperate items to web services, aggregating the responses, sending them back to the caller. (Doesn't work yet because Request-Response hasn't been implemented yet; future version)&lt;/li&gt;
    &lt;li&gt;Receiving incoming messages, block them with the ResequencerService, after a specified interval, start sending the messages to another system in a specified order.&lt;/li&gt;
    &lt;li&gt;If I missed an obvious scenario, please drop a comment!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Bram Veldhoen.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134765"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134765" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/134765.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2009/09/11/debatching-aggregation-and-resequencing-using-the-esb.extensions.aspx</guid>
            <pubDate>Fri, 11 Sep 2009 12:24:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/134765.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2009/09/11/debatching-aggregation-and-resequencing-using-the-esb.extensions.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/134765.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/134765.aspx</trackback:ping>
        </item>
        <item>
            <title>My beef with the ESB Toolkit 2.0 resolution framework</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2009/08/28/my-beef-with-the-esb-toolkit-2.0-resolution-framework.aspx</link>
            <description>&lt;p&gt;Lately, I have been working on an extension for the ESB Toolkit 2.0 for BizTalk Server 2009. &lt;a href="http://esbextensions.codeplex.com/"&gt;It can be found here on CodePlex&lt;/a&gt;. More posts about this ESB.Extensions solution will follow later, this particular post will describe why I think the ESB Toolkit's resolution framework should be improved.&lt;/p&gt;
&lt;p&gt;A short summary of how the ESB Toolkit resolution framework works. Resolvers are configured in the esb.config file using a specific name that can be coupled to a .NET type that needs to implement IResolveProvider. From the esb.config:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;&amp;lt;resolver name="BRE" type="Microsoft.Practices.ESB.Resolver.BRE.ResolveProvider, Microsoft.Practices.ESB.Resolver.BRE, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The above type implements IResolveProvider, and the ESB Toolkit provides a ResolverMgr and ResolverConfigHelper to allow for retrieving and caching the appropriate resolver types when the resolvers are retrieved from the itinerary and to be used by the itinerary service.&lt;/p&gt;
&lt;p&gt;Let's look at IResolveProvider:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;public interface IResolveProvider&lt;br /&gt;
{&lt;br /&gt;
    Dictionary&amp;lt;string, string&amp;gt; Resolve(ResolverInfo resolverInfo, XLANGMessage message);&lt;br /&gt;
    Dictionary&amp;lt;string, string&amp;gt; Resolve(string config, string resolver, XmlDocument message);&lt;br /&gt;
    Dictionary&amp;lt;string, string&amp;gt; Resolve(string config, string resolver, IBaseMessage message, IPipelineContext pipelineContext);&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;IResolveProvider provides three methods that all perform more or less the same task: resolve some information into a Dictionary&amp;lt;string, string&amp;gt;. My main problem with this approach it that everything that needs to be resolved needs to be in the form of string in order to be applicable for this way of resolution. I would expect a generic resolution framework to be more generic than that!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;To make matters worse, there are limitations to which keys you are allowed to use in the resolution dictionary, if you're using the out of the box resolvers (i.e. the BRE resolver). Basically, you're stuck with the keys that are provided on the Microsoft.Practices.ESB.Resolver.Resolution type:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;[Serializable]&lt;br /&gt;
public sealed class Resolution : IContextParameters, ITransformParameters, IEndpointParameters&lt;br /&gt;
{&lt;br /&gt;
    ... private members &amp;amp; constructor (left out for brevity) ...&lt;/font&gt;&lt;font face=""&gt; &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;    public string Action { get; set; }&lt;br /&gt;
    public string ActionField { get; set; }&lt;br /&gt;
    public string CacheTimeout { get; set; }&lt;br /&gt;
    public string DocumentSpecNameField { get; set; }&lt;br /&gt;
    public string DocumentSpecStrongNameField { get; set; }&lt;br /&gt;
    public string EndpointConfig { get; set; }&lt;br /&gt;
    public string EpmRRCorrelationTokenField { get; set; }&lt;br /&gt;
    public bool FixJaxRpc { get; set; }&lt;br /&gt;
    public string InboundTransportLocationField { get; set; }&lt;br /&gt;
    public string InboundTransportTypeField { get; set; }&lt;br /&gt;
    public string InterchangeIdField { get; set; }&lt;br /&gt;
    public string IsRequestResponseField { get; set; }&lt;br /&gt;
    public string MessageExchangePattern { get; set; }&lt;br /&gt;
    public string MessageType { get; set; }&lt;br /&gt;
    public string MethodNameField { get; set; }&lt;br /&gt;
    public string OutboundTransportCLSID { get; set; }&lt;br /&gt;
    public string ReceiveLocationNameField { get; set; }&lt;br /&gt;
    public string ReceivePortNameField { get; set; }&lt;br /&gt;
    public bool Success { get; set; }&lt;br /&gt;
    public string TargetNamespace { get; set; }&lt;br /&gt;
    public string TransformType { get; set; }&lt;br /&gt;
    public string TransportLocation { get; set; }&lt;br /&gt;
    public string TransportNamespace { get; set; }&lt;br /&gt;
    public string TransportType { get; set; }&lt;br /&gt;
    public string WindowUserField { get; set; }&lt;br /&gt;
}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Where the three Interfaces (IContextParameters, ITransformParameters, IEndpointParameters) all define a seperate set of properties (which are implemented by the Resolution type, see above).&lt;/p&gt;
&lt;p&gt;The resolvers use this Resolution type to fill the (more generic) Dictionary&amp;lt;string, string&amp;gt; type using ResolverMgr.SetResolverDictionary:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;public static void SetResolverDictionary(Resolution resolution, Dictionary&amp;lt;string, string&amp;gt; ResolverDictionary)&lt;br /&gt;
{&lt;br /&gt;
    try&lt;br /&gt;
    {&lt;br /&gt;
        ResolverDictionary.Add("Resolver.Action", resolution.Action ?? string.Empty);&lt;br /&gt;
        ResolverDictionary.Add("Resolver.ActionField", resolution.ActionField ?? string.Empty);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;        ... more calls to ResolverDictionary.Add("Resolver.Xxx", resolution.Xxx ?? string.Empty); (removed for brevity) ... &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;        ResolverDictionary.Add("Resolver.TransportType", resolution.TransportType ?? string.Empty);&lt;br /&gt;
        ResolverDictionary.Add("Resolver.WindowUserField", resolution.WindowUserField ?? string.Empty);&lt;br /&gt;
    }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;   ... some exception handling ...&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;}&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;This basically means that you can only work with the properties that the Resolution type provides. I see that as another limitation, because it means that the current resolvers are limited to only be able to resolve those properties. If I want to resolve a string value, that does not correspond to one of the properties of the Resolution type, I have two options:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Abuse one of the properties of the Resolution type. I.e. put a pipeline type name in the property TransformType. I started with this workaround, but it became a problem because I needed to resolve more complex objects than just strings (more on that later).&lt;/li&gt;
    &lt;li&gt;Write a custom Resolver. For instance, this means that I would need to implement a custom BRE resolver, that does resolution using the BRE in exactly the same way as the standard BRE resolver, just because of the different property.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The conclusion is that at the moment, the resolvers are coupled to what those resolvers are actually resolving. That should be decoupled if you ask me.&lt;/p&gt;
&lt;p&gt;I took a stab at improving this situation by implementing a resolution framework that uses the following interface:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;    public interface IResolutionProvider&lt;br /&gt;
    {&lt;br /&gt;
        ResolutionDictionary Resolve(ResolverInfo resolverInfo, XLANGMessage message);&lt;br /&gt;
        ResolutionDictionary Resolve(string config, string resolver, XmlDocument message);&lt;br /&gt;
        ResolutionDictionary Resolve(string config, string resolver, IBaseMessage message, IPipelineContext pipelineContext);&lt;br /&gt;
    }&lt;/font&gt;&lt;/p&gt;
&lt;font face=""&gt;
&lt;p&gt;&lt;br /&gt;
Where ResolutionDictionary looks like this:&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;    [Serializable]&lt;br /&gt;
    public class ResolutionDictionary : Dictionary&amp;lt;string, object&amp;gt;, ISerializable&lt;br /&gt;
    {&lt;br /&gt;
        public ResolutionDictionary()&lt;br /&gt;
        {&lt;br /&gt;
        }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;        public void SetValue(string key, object value)&lt;br /&gt;
        {&lt;br /&gt;
            base.Add(key, value);&lt;br /&gt;
        }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;        public object GetValue(string key)&lt;br /&gt;
        {&lt;br /&gt;
            if (base.ContainsKey(key))&lt;br /&gt;
            {&lt;br /&gt;
                return base[key];&lt;br /&gt;
            }&lt;br /&gt;
            return null;&lt;br /&gt;
        }&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;        public string GetString(string key)&lt;br /&gt;
        {&lt;br /&gt;
            return GetValue(key) as string;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;This dictionary allows resolvers to resolve anything, for as long as the resolution objects are serializable. It also allows for using any key value (string). The code, that's calling this kind of resolution, will be responsible for casting the object to the type that it expects.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The ESB.Extensions resolution framework, that uses the above IResolutionProvider and ResolutionDictionary, is still compatible with the esb configuration and the itinerary designer.&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;A full example can be found the in the &lt;a href="http://esbextensions.codeplex.com/"&gt;ESB.Extensions solution on codeplex&lt;/a&gt;. I use the resolution framework there to resolve parameters needed in a couple of services: ReceivePipelineService, SendPipelineService and Resequencer services. I implemented some BRE vocabularies to enable for creating the resolution objects.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;Off course, any feedback is welcome!&lt;/font&gt;&lt;/p&gt;
&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134364"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=134364" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/134364.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2009/08/28/my-beef-with-the-esb-toolkit-2.0-resolution-framework.aspx</guid>
            <pubDate>Fri, 28 Aug 2009 12:32:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/134364.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2009/08/28/my-beef-with-the-esb-toolkit-2.0-resolution-framework.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/134364.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/134364.aspx</trackback:ping>
        </item>
        <item>
            <title>Promoted property bug in XmlDisAsm component?</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2009/07/27/promoted-property-bug-in-xmldisasm-component.aspx</link>
            <description>&lt;p&gt;I have just uploaded a bug report (#&lt;font face=""&gt;477852&lt;/font&gt; on Microsoft Connect) regarding a highly specific scenario using the XmlReceive pipeline.&lt;font face=""&gt; It involves having an envelope and a document schema, in which the document schema contains an element (or attribute) that is promoted &lt;strong&gt;&lt;em&gt;both as a distinguished AND as a promoted property&lt;/em&gt;&lt;/strong&gt;. In this case, after processing by the XmlReceive pipeline, the property is only present in the message context as a distinguished property, and &lt;strong&gt;&lt;em&gt;NOT as a promoted property&lt;/em&gt;&lt;/strong&gt;. Some other people may have experienced this same issue:&lt;/font&gt;&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.biztalkgurus.com/forums/p/12435/24295.aspx"&gt;http://www.biztalkgurus.com/forums/p/12435/24295.aspx&lt;/a&gt; (Greg Forsythe nailed it)&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.eggheadcafe.com/conversation.aspx?messageid=30040782&amp;amp;threadid=30040773"&gt;http://www.eggheadcafe.com/conversation.aspx?messageid=30040782&amp;amp;threadid=30040773&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.server/2008-10/msg00018.html"&gt;http://www.tech-archive.net/Archive/BizTalk/microsoft.public.biztalk.server/2008-10/msg00018.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;(Trust me, it took me time to figure this one out).&lt;/p&gt;
&lt;p&gt;I reproduced this behaviour both on a BizTalk Server 2009 deployment and in standalone mode with the ExecuteRecievePipelineStep, found in BizUnit 3.1. See the screenshots below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="1280" height="424" src="/images/geekswithblogs_net/BVeldhoen/BugInXmlDisAsm/Schema0.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="1717" height="292" src="/images/geekswithblogs_net/BVeldhoen/BugInXmlDisAsm/MissingProperty.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;(For the BizUnit ExecuteReceivePipelineStep intimi: I used test T_015, added both a distinguished and a promoted property to the Child1Attribute1 attribute (which is of type string) from schema0.xsd, and pointed it to promoted Property2 (which is of type string); then I ran the test. The screenshots above show that the promoted Property2 property isn't there).&lt;/p&gt;
&lt;p&gt;I have not tested this with the FFDisAsm, I'll leave that to other enthousiasts.&lt;/p&gt;
&lt;p&gt;Was it fun? Not always :). Was it useful? You decide!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133734"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=133734" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/133734.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2009/07/27/promoted-property-bug-in-xmldisasm-component.aspx</guid>
            <pubDate>Mon, 27 Jul 2009 19:06:15 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/133734.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2009/07/27/promoted-property-bug-in-xmldisasm-component.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/133734.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/133734.aspx</trackback:ping>
        </item>
        <item>
            <title>BizTalk ESB Guidance 2.0 - Fixing the Itinerary OnRamp?</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2009/02/24/biztalk-esb-guidance-2.0---fixing-the-itinerary-onramp.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;First off, for a very good presentation about what an ESB could be, watch Mark Richards &lt;a href="http://www.infoq.com/presentations/Enterprise-Service-Bus"&gt;here&lt;/a&gt;. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Recently, I have taken a look at the &lt;a href="http://www.codeplex.com/esb"&gt;new-and-improved ESB Guidance 2.0 for BizTalk Server 2009 Beta&lt;/a&gt;. The ESB Guidance contains some interesting and potentially powerful concepts. Where BizTalk provides ESB-functionality out of the box (routing, transformation, etc., etc.), the ESB Guidance allows for a much more dynamic approach to realize these functionalities. With ESB Guidance, the majorities of these functionalities (i.e. dynamic routing and/or dynamic transformation) can be used by the client applications of the ESB (the systems sending messages to BizTalk) in the form of an ESB Guidance specific soap header called an Itinerary header. These Itinerary headers describe the processing steps that the message should go through within the ESB, and this Itinerary header could be different per message if that were necessary.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This approach offers a great deal of flexibility, because per each separate message coming from one of the ESB clients, it's path through the ESB can be set individually. However, it also means that those clients will need to be aware of the ESB Guidance Itinerary concept and have some way to add the Itinerary headers in the soap header of the message. Next to that, if there are changes to or within the ESB (configuration changes, system replacements), there's a chance that the Itinerary header will have to be changed as well.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In order to circumvent introducing this dependency of the ESB clients to the Itinerary concept, wouldn't it be a good idea to have the ESB be responsible for assigning the Itinerary headers? The most obvious place I can think of doing just that would be in a custom pipeline component, which can be configured with the appropriate Itinerary information, and which will just add this Itinerary header to the message as it comes in into the ESB. Taking this approach, &lt;a href="http://www.masteringbiztalk.com/blogs/jon/PermaLink,guid,85e75dc6-a3fa-42b0-bd11-a3a0d29168a9.aspx"&gt;the ContextAdder pipeline component, written by Jon Flanders&lt;/a&gt;, comes to mind. Using the ContextAdder, together with &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8c2572a2-fb61-4016-a7a7-1c37518b39ff&amp;amp;displaylang=en"&gt;Saravana Kumar's article on design-time properties for custom pipeline components&lt;/a&gt;, I came up with a sample that does as I described above. You can &lt;a href="http://esbextensions.codeplex.com/"&gt;download it here&lt;/a&gt;. BTW, the pipeline component in this sample writes or promotes any set of properties you want it to, it's not specific to Itineraries.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The sample needs BizTalk 2009 and ESB Guidance 2.0. I worked with the ESB Guidance 2.0 October 2008 release, so there may be some discrepancies when using it with the January 2009 release. Configuring the pipeline component is somewhat tedious, as the xml syntax needs to be very specific (especially regarding &amp;amp;amp;lt;, &amp;amp;lt; and &amp;lt;). If using it for real, a way to programmatically generate the config would be a good enhancement.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The sample uses FILE receive locations only and uses a very simple Itinerary that uses the orchestration routing and transformation services, configured with the STATIC resolvers. A screenshot of the pipeline configuration is displayed below.&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="1070" height="630" src="/images/geekswithblogs_net/BVeldhoen/FixedItinerary/ConfigurePipelineScreenshot.JPG" /&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I'd be very interested in other's thoughts on this approach, so drop me a comment!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;[27-02-2009] Nick Hauenstein pointed out that the January 2009 CTP2 release of ESB Guidance 2.0 contains a much better way to achieve the same result: static Itineraries, which can be set within a pipeline component. &lt;a href="http://www.quicklearn.com/blog/post/ESB-Guidance-20-Build-Loosely-Coupled-Solutions-You-Can-Be-Proud-Of.aspx"&gt;Check out his post&lt;/a&gt;!&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129634"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=129634" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/129634.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2009/02/24/biztalk-esb-guidance-2.0---fixing-the-itinerary-onramp.aspx</guid>
            <pubDate>Tue, 24 Feb 2009 16:55:44 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/129634.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2009/02/24/biztalk-esb-guidance-2.0---fixing-the-itinerary-onramp.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/129634.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/129634.aspx</trackback:ping>
        </item>
        <item>
            <title>Combining BizTalk Software Factory and BizTalk Deployment Framework</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/combining-biztalk-software-factory-and-biztalk-deployment-framework.aspx</link>
            <description>&lt;p&gt;Recently I have finished a preliminary version of an adaptation of the &lt;a href="http://www.codeplex.com/bsf"&gt;BizTalk Software Factory guidance automation package, owned by Jean-Paul Smit and Dick Dijkstra&lt;/a&gt; (BSF), where I have extended the functionality of the BizTalk Software Factory with support for &lt;a href="http://www.codeplex.com/biztalkdeployment"&gt;Scott Colestock's BizTalk Deployment Framework&lt;/a&gt; (BDF). The latest changeset (&lt;font face="Arial"&gt;17321) of the BSF source contains these changes, so you can testdrive it yourself!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The main advantage of using BSF and BDF in conjunction is that you should be able to produce a full BizTalk compilable and deployable solution within minutes using a few mouseclicks (ok, and some keyboard entries), leaving a situation where you have a repeatable development and deployment process from day 1, whilst maintaining strict naming conventions. After generating the solution, you will still be able to enjoy the full functionality of the BDF.&lt;/p&gt;
&lt;p&gt;During the wizard pages of the BSF, you will be prompted to enter some BDF specific settings:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="141" height="141" src="/images/geekswithblogs_net/BVeldhoen/BSF/WizardPage.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PreProcess Bindings&lt;/strong&gt;: If unchecked, you will get a regular bindings file that will not be processed by ElementTunnel.exe or XmlPreProcess.exe. If checked, you will get a bindingsMaster file, that will be processed by the two mentioned exe's.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Add VDirList&lt;/strong&gt;: If unchecked, you will not get a VDirList file (so you won't be exposing webservices). If checked, you will get a VDirList file, that you will have to edit manually to contain your vdir mappings.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Company Name&lt;/strong&gt;: The company name that is used in the generation of the Windows Installer (msi).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Copy DeployTools, Copy WiXSetup&lt;/strong&gt;: If unchecked, no files will be copied. If checked, BSF will copy the BDF DeployTools and WiXSetup directories into your solution root folder. To keep things simple, the files in these directories will not be added to your solution.&lt;/p&gt;
&lt;p&gt;The BDF offers &lt;em&gt;many many&lt;/em&gt; more settings to play with, but I decided to keep things simple and limit the configurable settings to those that would alter the solution structure or the files within the solution.&lt;/p&gt;
&lt;p&gt;The BSF will generate the following solution artifacts:&lt;/p&gt;
&lt;p&gt;&lt;img alt="" width="256" height="309" src="/images/geekswithblogs_net/BVeldhoen/BSF/SolutionExplorer.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;So after preparing your environment for BDF, you should be able to deploy your (completely empty) solution to BizTalk via the generated msi! (To do this: select the *.WiXSetup.build file in solution explorer, then in VS2005 Tools execute "NAnt Current Target").&lt;/p&gt;
&lt;p&gt;To prepare your environment, you basically only have to run MakeExternalTools_VS2005.vbs and make sure all paths in this .vbs file are correct (see &lt;font face="Arial"&gt;BizTalkSoftwareFactory\BDF\Info)&lt;/font&gt;, but refer to the BDF docs for complete documentation.&lt;/p&gt;
&lt;p&gt;Have fun.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125999"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125999" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/125999.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/combining-biztalk-software-factory-and-biztalk-deployment-framework.aspx</guid>
            <pubDate>Wed, 22 Oct 2008 18:07:12 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/125999.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/combining-biztalk-software-factory-and-biztalk-deployment-framework.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/125999.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/125999.aspx</trackback:ping>
        </item>
        <item>
            <title>Unit testing BizTalk artifacts using BizUnit</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/unit-testing-biztalk-artifacts-using-bizunit.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;First off, credit where credit's due: Tomas Restrepo has done an &lt;em&gt;amazing&lt;/em&gt; job making pipeline testing way easier with the pipeline testing library. Read all about it &lt;a href="http://www.winterdom.com/weblog/2007/08/09/PipelineTesting11Released.aspx"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Tomas' library inspired me to write some test steps for the &lt;a href="http://www.codeplex.com/bizunit"&gt;BizUnit framework&lt;/a&gt; that would allow for true unit testing of BizTalk components: being able to test BizTalk components without having to deploy the components to a BizTalk server, making testing roundtrips easier and overall less painfull. As additional advantage, you can have all tests use a similar approach/syntax, and use the already present validation steps to validate the results. I have implemented the following steps for BizUnit:&lt;br /&gt;
- ExecuteMapStep&lt;br /&gt;
- ExecuteReceivePipelineStep&lt;br /&gt;
- ExecuteSendPipelineStep&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Obviously, the latter two are using Tomas' pipeline testing library.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The ExecuteMapStep step can be used to test biztalk maps, using an input xml file. An example of a BizUnit test, that executes a map and validates the resulting output xml file (via the BizUnit context), is displayed below. &lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&amp;lt;TestCase testName="T_006_ExecuteMapStepWithValidationWithContextLoader"&amp;gt;&lt;br /&gt;  &amp;lt;TestExecution&amp;gt;&lt;br /&gt;    &amp;lt;TestStep assemblyPath="BizUnit.BizTalkSteps.dll" typeName="BizUnit.BizTalkSteps.ExecuteMapStep"&amp;gt;&lt;br /&gt;      &amp;lt;Map assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.MapSchema1ToSchema2"/&amp;gt;&lt;br /&gt;      &amp;lt;Source&amp;gt;..\..\..\Test\BizUnit.BizTalkTestArtifacts\Instances\Schema1.xml&amp;lt;/Source&amp;gt;&lt;br /&gt;      &amp;lt;Destination&amp;gt;Schema2.006.xml&amp;lt;/Destination&amp;gt;&lt;br /&gt;      &amp;lt;ContextLoaderStep assemblyPath="" typeName="BizUnit.XmlContextLoader"&amp;gt;&lt;br /&gt;        &amp;lt;XPath contextKey="testValue"&amp;gt;/*[local-name()='Schema2Root' and namespace-uri()='http://BizUnit.BizTalkTestArtifacts.Schema2']/*[local-name()='Child1' and namespace-uri()='']/@*[local-name()='Child1Attribute1' and namespace-uri()='']&amp;lt;/XPath&amp;gt;&lt;br /&gt;      &amp;lt;/ContextLoaderStep&amp;gt;&lt;br /&gt;      &amp;lt;ValidationStep assemblyPath="" typeName="BizUnit.ContextValidationStep"&amp;gt;&lt;br /&gt;        &amp;lt;Context keyName="testValue"&amp;gt;1&amp;lt;/Context&amp;gt;&lt;br /&gt;      &amp;lt;/ValidationStep&amp;gt;&lt;br /&gt;    &amp;lt;/TestStep&amp;gt;&lt;br /&gt;  &amp;lt;/TestExecution&amp;gt;&lt;br /&gt;&amp;lt;/TestCase&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The ExecuteReceivePipelineStep and ExecuteSendPipelineStep let you test receive or send pipelines. The input for both the ExecuteReceivePipelineStep and ExecuteSendPipelineStep (optionally) consists of:&lt;br /&gt;
- Per-instance pipeline configuration&lt;br /&gt;
- Document specs&lt;br /&gt;
- Input xml file (multiple input files can be specified for the ExecuteSendPipelineStep)&lt;br /&gt;
- Message context input file(s): an xml file, containing all context properties (name, namespace, value, and whether these properties are &lt;strong&gt;promoted&lt;/strong&gt; or not)&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;strong&gt;ExecuteReceivePipelineStep:&lt;/strong&gt;&lt;/p&gt;
&lt;/font&gt;
&lt;pre&gt;&amp;lt;TestStep assemblyPath="BizUnit.BizTalkSteps.dll" typeName="BizUnit.BizTalkSteps.ExecuteReceivePipelineStep"&amp;gt;&lt;br /&gt;  &amp;lt;Pipeline assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.ReceivePipeline1"&amp;gt;&lt;br /&gt;    &amp;lt;InstanceConfigFile&amp;gt;..\..\..\Test\BizUnit.BizTalkSteps.Tests\TestData\ReceivePipeline3.InstanceConfig.xml&amp;lt;/InstanceConfigFile&amp;gt;&lt;br /&gt;    &amp;lt;DocSpecs&amp;gt;&lt;br /&gt;      &amp;lt;DocSpec assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.Schema0" /&amp;gt;&lt;br /&gt;      &amp;lt;DocSpec assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.Schema3Env" /&amp;gt;&lt;br /&gt;    &amp;lt;/DocSpecs&amp;gt;&lt;br /&gt;  &amp;lt;/Pipeline&amp;gt;&lt;br /&gt;  &amp;lt;InputContextFile&amp;gt;..\..\..\Test\BizUnit.BizTalkSteps.Tests\TestData\Context.0.xml&amp;lt;/InputContextFile&amp;gt;&lt;br /&gt;  &amp;lt;Source&amp;gt;..\..\..\Test\BizUnit.BizTalkTestArtifacts\Instances\Schema3Env.xml&amp;lt;/Source&amp;gt;&lt;br /&gt;  &amp;lt;DestinationFileFormat&amp;gt;Output015.{0}.xml&amp;lt;/DestinationFileFormat&amp;gt;&lt;br /&gt;  &amp;lt;OutputContextFileFormat&amp;gt;Context015.{0}.xml&amp;lt;/OutputContextFileFormat&amp;gt;&lt;br /&gt;&amp;lt;/TestStep&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;strong&gt;ExecuteSendPipelineStep:&lt;/strong&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;TestStep assemblyPath="BizUnit.BizTalkSteps.dll" typeName="BizUnit.BizTalkSteps.ExecuteSendPipelineStep"&amp;gt;&lt;br /&gt;  &amp;lt;Pipeline assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.SendPipeline1"&amp;gt;&lt;br /&gt;    &amp;lt;InstanceConfigFile&amp;gt;..\..\..\Test\BizUnit.BizTalkSteps.Tests\TestData\SendPipeline3.InstanceConfig.xml&amp;lt;/InstanceConfigFile&amp;gt;&lt;br /&gt;    &amp;lt;DocSpecs&amp;gt;&lt;br /&gt;      &amp;lt;DocSpec assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.Schema0" /&amp;gt;&lt;br /&gt;      &amp;lt;DocSpec assemblyPath="..\..\..\Test\BizUnit.BizTalkTestArtifacts\bin\Development\BizUnit.BizTalkTestArtifacts.dll" typeName="BizUnit.BizTalkTestArtifacts.Schema3Env" /&amp;gt;&lt;br /&gt;    &amp;lt;/DocSpecs&amp;gt;&lt;br /&gt;  &amp;lt;/Pipeline&amp;gt;&lt;br /&gt;  &amp;lt;InputContextDir&amp;gt;..\..\..\Test\BizUnit.BizTalkSteps.Tests\TestData&amp;lt;/InputContextDir&amp;gt;&lt;br /&gt;  &amp;lt;InputContextSearchPattern&amp;gt;Context*.xml&amp;lt;/InputContextSearchPattern&amp;gt;&lt;br /&gt;  &amp;lt;SourceDir&amp;gt;..\..\..\Test\BizUnit.BizTalkTestArtifacts\Instances\&amp;lt;/SourceDir&amp;gt;&lt;br /&gt;  &amp;lt;SearchPattern&amp;gt;Child*.xml&amp;lt;/SearchPattern&amp;gt;&lt;br /&gt;  &amp;lt;Destination&amp;gt;Output.025.xml&amp;lt;/Destination&amp;gt;&lt;br /&gt;  &amp;lt;OutputContextFile&amp;gt;Context.024.xml&amp;lt;/OutputContextFile&amp;gt;&lt;br /&gt;&amp;lt;/TestStep&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;
&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;div align="left"&gt;
&lt;pre&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Per-instance pipeline configuration:&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face="Arial"&gt;Below the per-instance pipeline configuration of a pipeline, containing only the Xml Disassembler pipeline component.&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;?xml version="1.0" encoding="utf-8"?&amp;gt;&lt;br /&gt;&amp;lt;Root xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;&lt;br /&gt;  &amp;lt;Stages&amp;gt;&lt;br /&gt;    &amp;lt;Stage CategoryId="9d0e4105-4cce-4536-83fa-4a5040674ad6"&amp;gt;&lt;br /&gt;      &amp;lt;Components&amp;gt;&lt;br /&gt;        &amp;lt;Component Name="Microsoft.BizTalk.Component.XmlDasmComp"&amp;gt;&lt;br /&gt;          &amp;lt;Properties&amp;gt;&lt;br /&gt;            &amp;lt;EnvelopeSpecNames vt="8"&amp;gt;BizUnit.BizTalkTestArtifacts.Schema3Env&amp;lt;/EnvelopeSpecNames&amp;gt;&lt;br /&gt;            &amp;lt;EnvelopeSpecTargetNamespaces vt="8"&amp;gt;http://BizUnit.BizTalkTestArtifacts.Schema3Env&amp;lt;/EnvelopeSpecTargetNamespaces&amp;gt;&lt;br /&gt;            &amp;lt;DocumentSpecNames vt="8"&amp;gt;BizUnit.BizTalkTestArtifacts.Schema0&amp;lt;/DocumentSpecNames&amp;gt;&lt;br /&gt;            &amp;lt;DocumentSpecTargetNamespaces vt="8"&amp;gt;http://BizUnit.BizTalkTestArtifacts.Schema0&amp;lt;/DocumentSpecTargetNamespaces&amp;gt;&lt;br /&gt;            &amp;lt;AllowUnrecognizedMessage vt="11"&amp;gt;false&amp;lt;/AllowUnrecognizedMessage&amp;gt;&lt;br /&gt;            &amp;lt;ValidateDocument vt="11"&amp;gt;false&amp;lt;/ValidateDocument&amp;gt;&lt;br /&gt;            &amp;lt;RecoverableInterchangeProcessing vt="11"&amp;gt;false&amp;lt;/RecoverableInterchangeProcessing&amp;gt;&lt;br /&gt;            &amp;lt;HiddenProperties vt="8"&amp;gt;EnvelopeSpecTargetNamespaces,DocumentSpecTargetNamespaces&amp;lt;/HiddenProperties&amp;gt;&lt;br /&gt;          &amp;lt;/Properties&amp;gt;&lt;br /&gt;        &amp;lt;/Component&amp;gt;&lt;br /&gt;      &amp;lt;/Components&amp;gt;&lt;br /&gt;    &amp;lt;/Stage&amp;gt;&lt;br /&gt;  &amp;lt;/Stages&amp;gt;&lt;br /&gt;&amp;lt;/Root&amp;gt;&lt;/pre&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Context xml file:&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/font&gt;
&lt;pre&gt;&amp;lt;MessageInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&amp;gt;&lt;br /&gt;  &amp;lt;ContextInfo PropertiesCount="1"&amp;gt;&lt;br /&gt;    &amp;lt;Property Name="Property1" Namespace="http://BizUnit.BizTalkTestArtifacts.PropertySchema1" Value="10" Promoted="true" /&amp;gt;&lt;br /&gt;  &amp;lt;/ContextInfo&amp;gt;&lt;br /&gt;&amp;lt;/MessageInfo&amp;gt;&lt;/pre&gt;
&lt;font face="Arial"&gt;
&lt;pre&gt;&lt;font face="Arial"&gt;The code (including tests) have already been uploaded to the owner of BizUnit. I don't know when the next release for BizUnit is planned. If you need the code for these BizUnit steps, send me an email.&lt;/font&gt;&lt;/pre&gt;
&lt;/font&gt;&lt;font face="Arial"&gt;&lt;font face="Arial"&gt;
&lt;p&gt;The output of the steps consist of:&lt;br /&gt;
- Xml output file&lt;br /&gt;
- Message context xml file, with the same format as the input context xml file..&lt;/p&gt;
 The example below displays a BizUnit validation step snippet that checks if a certain property was promoted and has value 10:
&lt;p&gt; &lt;/p&gt;
&lt;/font&gt;&amp;lt;ValidationStep assemblyPath="" typeName="BizUnit.XmlValidationStepEx"&amp;gt;&lt;br /&gt;
  &amp;lt;XPathList&amp;gt;&lt;br /&gt;
    &amp;lt;XPathValidation query="MessageInfo/ContextInfo/Property[@Name='Property1' and @Namespace='http://BizUnit.BizTalkTestArtifacts.PropertySchema1' and @Promoted='true']/@Value"&amp;gt;10&amp;lt;/XPathValidation&amp;gt;&lt;br /&gt;
  &amp;lt;/XPathList&amp;gt;&lt;br /&gt;
&amp;lt;/ValidationStep&amp;gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div align="left"&gt;[19-07-2009]: The ExecuteMapStep, ExecuteReceivePipelineStep and ExecuteSendPipelineStep have been included in BizUnit 3.1, which is now available at &lt;a href="http://bizunit.codeplex.com/"&gt;codeplex&lt;/a&gt;. Thanks, Kevin!&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125998"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=125998" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/125998.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/unit-testing-biztalk-artifacts-using-bizunit.aspx</guid>
            <pubDate>Wed, 22 Oct 2008 17:30:40 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/125998.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/10/22/unit-testing-biztalk-artifacts-using-bizunit.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/125998.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/125998.aspx</trackback:ping>
        </item>
        <item>
            <title>Messaging-only request-response correlation</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/08/20/messaging-only-request-response-correlation.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;Recently I was asked if it was possible to "couple" two services via BizTalk without using orchestrations. Let's look at that required scenario more closely:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="296" alt="" width="884" src="/images/geekswithblogs_net/BVeldhoen/MessagingOnlyReqResp/ReqRespCorr.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;1. A request message (ReqA) is received on the WCF-BasicHttp Receive Adapter, and it is posted to the MsgBox.&lt;br /&gt;
2. A solicit-response send port is activated due to a subscribtion to ReqA.&lt;br /&gt;
3. ReqA is mapped to ReqB.&lt;br /&gt;
4. ReqB is sent via the WCF-BasicHttp Send Adapter&lt;br /&gt;
5. RespB is received by the WCF-BasicHttp Send Adapter.&lt;br /&gt;
6. RespB is mapped to RespA and it is posted to the MsgBox.&lt;br /&gt;
6. RespB is picked up by the appropriate instance of the request-response receive port due to an instance subscription.&lt;br /&gt;
7. RespA is sent via the WCF-BasicHttp Receive Adapter.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The first questions that came up with me were:&lt;br /&gt;
&lt;strong&gt;1.&lt;/strong&gt; How can the response of the outgoing webservice call be correlated to the incoming one? In the above scenario, that question would be "How can response B be correlated to response A?". I certainly didn't know that that comes out of the box with BizTalk. How? We'll see that later on.&lt;br /&gt;
&lt;strong&gt;2.&lt;/strong&gt; What happens if we configure multple (outgoing) solicit-response send ports, subscribing to messages coming in on the one request-response receive port? Will timing issues start to play a role? Or will an exception be thrown?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Before answering these questions, I would like to say that &lt;a href="http://www.soapui.org/"&gt;SoapUI&lt;/a&gt; is simply AWESOME when developing/working with web services (yes, including WCF web services). True, it's JAVA application, but still... :) It blows other webservice related stuff I've seen out of the water. Give it a try! In the above example, I used SoapUI to submit requests/receive responses to/from the WCF service, coupled to the request-response receive location.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In order to answer &lt;strong&gt;question 1&lt;/strong&gt;, we could check the instance subscription generated when a message is received on the request-response receive port (by stopping -but not unenlisting- the subscribing sendport  and submitting a request), and it's as follows:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;http://schemas.microsoft.com/BizTalk/2003/system-properties.EpmRRCorrelationToken == &lt;font color="#800000"&gt;Svr:WIN2003EER2SP2;PID:3092;RRUid:{9731CF80-DDCF-4BB8-9CCA-03651243AE3E}&lt;/font&gt;  &lt;strong&gt;And&lt;/strong&gt;&lt;br /&gt;
http://schemas.microsoft.com/BizTalk/2003/system-properties.RouteDirectToTP == &lt;font color="#800000"&gt;True&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Documentation on those properties is hard to come by. The BizTalk documentation states:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;BTS.EpmRRCorrelationToken&lt;br /&gt;
Promoted by the Messaging Engine on request-response message execution. The property is promoted before messages are submitted into the MessageBox database.&lt;br /&gt;
Used internally by the Messaging Engine. Specifies the Server Name, Process ID and a unique GUID for a request response stream of messages.&lt;br /&gt;
 &lt;br /&gt;
BTS.RouteDirectToTP&lt;br /&gt;
Promoted by the Messaging Engine on messages for loop back or request-response execution. The property is promoted before messages are submitted into the MessageBox database.&lt;br /&gt;
Used internally by the Messaging Engine to enable loop back and request-response scenarios.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Anyone will agree that &amp;lt;censored&amp;gt;. However, from the fact that the above example is indeed working, we can assume that the EpmRRCorrelationToken property value is copied to the contexts of all messages involved in the communication flow. This implies that the EpmRRCorrelationToken property "survives" maps, the WCF solicit-response adapter and the XmlReceive pipeline. If you'd check the message context of the response message, published by the solicit-response port, you'll find those properties present and promoted.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Question 2&lt;/strong&gt; can be answered fairly quickly. Configure &amp;amp; start a second solicit-response send port, and then fire a message into the request-response receive port (i.e. using SoapUI). This will give you a routing failure in BizTalk and the following soap fault on the soap client:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;"The message found multiple request response subscriptions. A message can only be routed to a single request response subscription."&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Which basically means that a message just won't get processed in this scenario. Makes sense, but would you have predicted that? Searching the web found a &lt;a href="http://support.microsoft.com/kb/923632"&gt;hotfix (KB&lt;font face="Arial"&gt;923632)&lt;/font&gt;&lt;/a&gt;, that apparently enables scenarios where multiple request response subscriptions should be allowed. If you can think of a decent scenario where this would be needed, leave a comment!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;em&gt;How could we use this information?&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
One scenario could be to have an orchestration that uses two separate direct bound orchestration ports (one receive and one send), instead of one receiving request-response orchestration port to process the request and to submit a response. &lt;/font&gt;So instead of having an original request-response port, bound to a physical request-response port ("specify later"), like this:&lt;/p&gt;
&lt;p&gt; &lt;img height="377" alt="" width="314" src="/images/geekswithblogs_net/BVeldhoen/MessagingOnlyReqResp/ReqRespOrch(1).JPG" /&gt;&lt;/p&gt;
&lt;p&gt;...we create an orchestration with two separate direct bound ports like this:&lt;/p&gt;
&lt;p&gt;&lt;img height="448" alt="" width="349" src="/images/geekswithblogs_net/BVeldhoen/MessagingOnlyReqResp/SeperateReqRespOrch.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Where the receive shape (Receive_1) has the following filter expression: (BTS.MessageType == "&lt;font color="#800000"&gt;http://Blah.BlahBlah.Schema1#Schema1Root&lt;/font&gt;")&lt;br /&gt;
The SetContext expression shape looked like this: &lt;strong&gt;Message_2(*) = Message_1(*);&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The result was that the response message (actually, better to say the transformed message, because we're intentionally trying to avoid request-response terminology here) couldn't be routed back to the physical request-response port (routing failure). Checking the message context revealed that the EpmRRCorrelationToken and RouteDirectToTP were present (due to copying over the properties), but they were not promoted, which is correct (because setting properties in an expression shape within an orchestration does not promote them). This can be solved by adding a correlation type and set, using these two context properties, and setting the send shape to initialize this correlation set. The result was that the message was correctly picked up by the subscribing request-response port, but another error occurred::&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;Event Type: Error&lt;br /&gt;
Event Source:   BizTalk Server 2006&lt;br /&gt;
Event Category: BizTalk Server 2006 &lt;br /&gt;
Event ID:   5813&lt;br /&gt;
Date:       8/19/2008&lt;br /&gt;
Time:       11:17:27 PM&lt;br /&gt;
User:       N/A&lt;br /&gt;
Computer:   WIN2003EER2SP2&lt;br /&gt;
Description:&lt;br /&gt;
A response message for two-way receive port "ReceivePort1" is being suspended as the messaging engine could not correlate the response to an existing request message. This usually happens when the host process has been recycled. &lt;br /&gt;
 &lt;br /&gt;
 MessageId:  {A817F71C-5AC0-4CEB-BAAC-C60EFED8D92E}&lt;br /&gt;
 InstanceID: {B931AE36-5C9F-4B23-8697-DCC79E0A76DF}&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Hmmmm, what's all this about? Apparently some required properties, that are used internally by BizTalk for request response correlation, weren't satisfied. After some fiddling around with context properties, performing a lot of &lt;a href="http://winmerge.org/"&gt;WinMerge&lt;/a&gt; actions to compare message contexts (of the messages coming from the solicit-response ports (see above) and the messages coming from the orchestration), and most importantly, by finding &lt;a href="http://blogs.msdn.com/paolos/archive/2008/07/21/msdn-blogs.aspx"&gt;this excellent post by Paolo Salvatori&lt;/a&gt;, describing exactly the property set needed, I changed the expression shape and the correlation type into the following:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Expression shape:&lt;br /&gt;
&lt;/strong&gt;Message_2(*) = Message_1(*);&lt;br /&gt;
Message_2(BTS.RouteDirectToTP) = true;&lt;br /&gt;
Message_2(BTS.IsRequestResponse) = true;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Correlation Type:&lt;br /&gt;
&lt;/strong&gt;BTS.CorrelationToken,BTS.EpmRRCorrelationToken,BTS.IsRequestResponse,BTS.ReqRespTransmitPipelineID,BTS.RouteDirectToTP&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The result was that the response was correctly picked up &amp;amp; processed by the instance-subscribing physical request-response port.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br /&gt;
A much overlooked feature of BizTalk is the ability to route responses without the need for orchestrations by using messaging only. This post described what happens internally in such a scenario and also described how that information can be used to create an orchestration, in which the request and response can be communicated over separate direct bound orchestration ports instead of over one request-response port, which can be helpful (for instance) for testing the orchestration using physical FILE ports.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124571"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124571" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/124571.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/08/20/messaging-only-request-response-correlation.aspx</guid>
            <pubDate>Wed, 20 Aug 2008 21:21:36 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/124571.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/08/20/messaging-only-request-response-correlation.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/124571.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/124571.aspx</trackback:ping>
        </item>
        <item>
            <title>Post-receive debatching without orchestrations</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/08/11/post-receive-debatching-without-orchestrations.aspx</link>
            <description>&lt;p&gt;&lt;font face="Arial"&gt;This post describes a way to perform debatching of a message after the original message has already been received and submitted to the BizTalk message box. This can be the case when for instance there are subscribers defined in BizTalk that subscribe to:&lt;br /&gt;
- The original message before debatching. To my knowledge, it isn't possible to post both the original message and the debatched messages to the BizTalk MsgBox.&lt;br /&gt;
- A mapped version of the original message. To my knowledge, it isn't possible to post both the original and the mapped messages to the BizTalk MsgBox.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So how do we handle a message in the BizTalk MsgBox, that needs to be debatched into seperate messages (without orchestrations)? Below a schematic representation of the solution used in this sample.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="410" alt="" width="967" src="/images/geekswithblogs_net/BVeldhoen/PostReceiveDebatch/Samples.Messaging(3).jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;org = Original Message: contains some elements that occur 0..n.&lt;br /&gt;
arr = Array Message: a non-envelope message containing 0..n entities to debatch&lt;br /&gt;
env = Envelope Message: BizTalk envelope message with identical structure to array message&lt;br /&gt;
msg 1, msg 2, ..., msg n = Debatched Messages&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The steps in the above scenario:&lt;br /&gt;
1. A solicit-response send port has a subscription filter for the original message.&lt;br /&gt;
2. An outbound map is performed, transforming the original message into an array message.&lt;br /&gt;
3. Within the NamespaceReplacing pipeline component, the namespace for the array message is replaced with the namespace of the envelope message (this is in fact a transformation, though not via a BizTalk map).&lt;br /&gt;
4. The Loopback Adapter bounces the envelope message.&lt;br /&gt;
5. The XmlDisassemble component in the XmlReceive pipeline debatches (splits) the envelope message into its seperate messages.&lt;br /&gt;
6. The seperate messages are posted to the BizTalk MsgBox for further processing.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In order to make this work, there are some specific requirements to how the BizTalk schemas are setup. Below the representation of the used BizTalk schemas.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img height="158" alt="" width="600" src="/images/geekswithblogs_net/BVeldhoen/PostReceiveDebatch/Samples.Messaging.Schemas.JPG" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;org = Original Message = OrdersRequest&lt;br /&gt;
arr = Array Message = InternalOrders&lt;br /&gt;
env = Envelope Message = InternalOrdersEnvelope&lt;br /&gt;
msg 1, msg 2, ..., msg n = Debatched Messages = InternalOrder&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Key thing here is that the array schema has an xml structure similar to the envelope schema. In fact, the envelope schema imports the array schema, and the envelope schema's root element type is set to be the same as the root element type of the array schema. The only differences between the array schema and the envelope schema are:&lt;br /&gt;
- The root namespace.&lt;br /&gt;
- The envelope schema is configured to be a BizTalk envelope schema, while the array schema is not.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;So why the Namespace replacing?&lt;br /&gt;
You may have noticed that the above could also be done by mapping from the original message to the envelope message directly, and not (have to) use the namespace replacing component. However, if you will try this, you will find that BizTalk doesn't allow to map TO envelope schemas, when that map is configured as inbound or outbound map on a BizTalk physical port. You'll get an error like:&lt;/font&gt;&lt;/p&gt;
&lt;font face="Arial"&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;em&gt;Event Type: Error&lt;br /&gt;
Event Source: BizTalk Server 2006&lt;br /&gt;
Event Category: BizTalk Server 2006 &lt;br /&gt;
Event ID: 5782&lt;br /&gt;
Date:  9/5/2008&lt;br /&gt;
Time:  10:19:52 PM&lt;br /&gt;
User:  N/A&lt;br /&gt;
Computer: WINXP&lt;br /&gt;
Description:&lt;br /&gt;
The Messaging Engine failed while executing the outbound map for the message going to the destination URL "LOOPBACK://cfc0607f-e119-4e6b-ae34-8fae2a92b084" with the Message Type "http://Samples.Messaging.Schemas.OrdersRequest#OrdersRequest". Details:"Document type "http://Samples.Messaging.Schemas.InternalOrder#InternalOrder" does not match any of the given schemas. "&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;I will send a chocky bar of choice to the first one to find the solution for this error, whereever you are!&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;In order to work around this issue, I have used the Namespace replacer component to perform a 1:1 map from the array schema to the envelope schema by replacing the root namespace. A true BizTalk map, with all elements from the array schema 'connected' to the corresponding elements in the envelope schema, should have had the same effect (were it not for the fact that BizTalk doesn't allow that on ports).&lt;br /&gt;
The Namespace replacer component has been implemented by using a lot of code from the Microsoft.Practices.ESB Namespace pipeline components (RemoveNamespace component). The Namespace replacer component takes two configuration parameters: OldNamespace and NewNamespace, and it just substitues the OldNamespace on all elements and attributes it encounters with the NewNamespace.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The XmlReceive pipeline configuration in this sample is pretty standard: debatching using an envelope schema, exactly like you would do on a 'normal' receive port.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;This sample provides a way to debatch (or normalize) a message on a single port without the need for orchestrations. Think of it as a debatching port or normalizing port. There are some limitations to this approach:&lt;br /&gt;
- Error handling isn't possible on a per-debatched-message basis. If debatching fails (on one debatched message), I assume you will get one suspended envelope message. When using orchestrations for debatching, the error handling could be done per debatched message. &lt;font color="#ff0000"&gt;[Update] This could (to some extent) be mitigated by turning on Recoverable Interchange Processing on the XmlReceive Pipeline in combination with Failed Message Routing.&lt;/font&gt;&lt;br /&gt;
- ...? Any additions are welcome.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;The sample runs on BizTalk Server 2006 R2. You can &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/BVeldhoen/PostReceiveDebatch/Samples.Messaging(1).zip"&gt;download it&lt;/a&gt;. &lt;font color="#ff0000"&gt;N.B. Updated on 05-09-2008: The "Copy properties" property of the LOOPBACK adapter needs to be set to False for this sample to work.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;Some other techniques for debatching messages are described &lt;a href="http://www.biztalkgurus.com/blogs/biztalk/archive/2005/07/12/XPath-Debatching-and-Envelope-Debatching-Biztalk-Lab.aspx"&gt;here&lt;/a&gt;. You can find the Loopback adapter &lt;a href="http://geekswithblogs.net/gwiele/archive/2004/11/10/14737.aspx"&gt;here&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;UPDATE (additional info):&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;Recently, I was pointed out that a more common way to re-use xsd types is by using element refs. I have tested this sample to see if it still works when using element refs instead of re-using the xsd types, and I found that it still works. Here's the changed &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/BVeldhoen/PostReceiveDebatch/Samples.Messaging.UsingElementRef.zip"&gt;sample using element ref in the envelope schema&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;Update [05-10-2008]:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;If you're interested in the namespace replacement, you're much better off writing a custom pipeline component that uses the &lt;font face="Arial"&gt;&lt;strong&gt;Microsoft.BizTalk.Component.NamespaceTranslatorStream&lt;/strong&gt; class, found in &lt;font face="Arial"&gt;&lt;strong&gt;Microsoft.BizTalk.Pipeline.Components&lt;/strong&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;/font&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124368"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=124368" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/124368.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/08/11/post-receive-debatching-without-orchestrations.aspx</guid>
            <pubDate>Tue, 12 Aug 2008 03:39:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/124368.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/08/11/post-receive-debatching-without-orchestrations.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/124368.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/124368.aspx</trackback:ping>
        </item>
        <item>
            <title>Recursive Orchestration</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/07/23/recursiveorchestration.aspx</link>
            <description>&lt;font size="3"&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;
&lt;p&gt;This post describes how to implement a recursive BizTalk orchestration using correlation sets. Using a recursive orchestration came up as a possible solution during one of my previous projects, where a message needed to be resubmitted with a changed status code, so that a new instance of the same orchestration type could pick it up for processing. Next to that, it's a fun excersize!&lt;/p&gt;
&lt;p&gt;You can't recurse orchestrations using the Call Orchestration or Start Orchestration shapes, because the Orchestration designer just doesn't let you select the same orchestration type as the one you're trying to start/call from. I haven't tried fooling the orchestration editor by editing the .odx file in the xml editor, but I can't imagine any other result than a compile-time error. From the BizTalk Server 2006 R2 Documentation:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Caution  &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;BizTalk Server 2006 does not support recursive orchestrations. If Orchestration A calls or starts Orchestration B, then Orchestration B cannot call or start Orchestration A directly, nor can it call or start any orchestration that directly or indirectly calls Orchestration A. &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;So assuming we have to rule out the use of the Call/Start orchestration shapes, we have to use another way to do the correlation. In come the correlation sets. The BizTalk documentation uses orchestration A and B in examples for orchestration communication (as in the example above), often assuming that orchestrations A and B are of different types. In the example below, I have used a standard way of correlation where orchestration A’s type equals orchestration B’s type.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;img height="1467" alt="Recursive Orchestration" width="800" src="/images/geekswithblogs_net/BVeldhoen/RecursiveOrch/RecursiveOrch.JPG" /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="FONT-SIZE: 9pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;It breaks down into 3 parts, where each part has two branches. The first part is where the request message gets received, the second part is where the child orchestration gets ‘called’ (using direct bound ports and correlation sets), and the third part is where the response gets sent. The correlation type used consists of only a guid (ctInstandeId), and the orchestration uses two correlation sets, both based on that one correlation type (csInstanceId1, csInstanceId2). &lt;/p&gt;
&lt;p&gt;The key point is to understand what using correlation sets does to the message context and subscriptions. The BizTalk documentation is more accurate (ms-help://MS.BTS.2006/BTS06CoreDocs/html/528dcd6c-d364-4bb8-8deb-cd4a0791867f.htm), but in my own words:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;An initializing receive creates ‘Exists’ subscription criteria on all correlation type properties. In the example orchestration, we create this ‘Exists’ subscription manually by using the filter expression on the RCVRECREQ receive shape. &lt;/li&gt;
    &lt;li&gt;An initializing send promotes the correlation type properties to the message context as promoted properties. In the example orchestration, we do this on the SNDRECREQ send shape. &lt;/li&gt;
    &lt;li&gt;A following receive creates an instance subscription based on the correlation type properties. In the example orchestration, we do this on the RCVRECRESP receive shape. &lt;/li&gt;
    &lt;li&gt;A following send promotes the correlation type properties to the message context as promoted properties. In the example orchestration, we don’t use this. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Subscriptions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is what the subscriptions look like.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;RCVRECREQ (activation subscription):&lt;/em&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="1"&gt;http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType == &lt;font color="#993300"&gt;http://RecursiveOrch.Request#Request&lt;/font&gt;  &lt;strong&gt;And&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt;http://RecursiveOrch.Properties.InstanceId &lt;strong&gt;Exists&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;RCVRECRESP (instance subscription):&lt;/em&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="1"&gt;http://RecursiveOrch.Properties.InstanceId == &lt;font color="#993300"&gt;c1c86b9c-4d01-4176-9a19-3908f46fe053&lt;/font&gt;  &lt;strong&gt;And&lt;/strong&gt;&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;font size="1"&gt;http://schemas.microsoft.com/BizTalk/2003/system-properties.MessageType == &lt;font color="#993300"&gt;&lt;a href="http://RecursiveOrch.Response#Response"&gt;http://RecursiveOrch.Response#Response&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;DebugView Output&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;font size="1"&gt;00000000                        0.00000000                    [5844] RCVINITREQ, id=1, count=0.               &lt;br /&gt;
00000001                        0.00035004                    [5844] SNDRECREQ, id=1, count=1.               &lt;br /&gt;
00000002                        0.24793179                    [5844] RCVRECREQ, id=1, count=1.               &lt;br /&gt;
00000003                        0.25474858                    [5844] SNDRECREQ, id=1, count=2.               &lt;br /&gt;
00000004                        0.75415730                    [5844] RCVRECREQ, id=1, count=2.               &lt;br /&gt;
00000005                        0.75665259                    [5844] SNDRECREQ, id=1, count=3.               &lt;br /&gt;
00000006                        1.26953459                    [5844] RCVRECREQ, id=1, count=3.               &lt;br /&gt;
00000007                        1.27350295                    [5844] RecursiveOrch - Recursion terminated for request, id=1, count=3.                     &lt;br /&gt;
00000008                        1.92181325                    [5844] SNDRECRESP, id=1, count=3.             &lt;br /&gt;
00000009                        2.32890010                    [5844] RCVRECRESP, id=1, count=3.             &lt;br /&gt;
00000010                        2.33078957                    [5844] SNDRECRESP, id=1, count=3.             &lt;br /&gt;
00000011                        2.53953433                    [5844] RCVRECRESP, id=1, count=3.             &lt;br /&gt;
00000012                        2.54006386                    [5844] SNDRECRESP, id=1, count=3.             &lt;br /&gt;
00000013                        3.03803825                    [5844] RCVRECRESP, id=1, count=3.             &lt;br /&gt;
00000014                        3.04450655                    [5844] SNDFINALRESP, id=1, count=3.&lt;/font&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can download the solution &lt;a href="http://geekswithblogs.net/images/geekswithblogs_net/BVeldhoen/RecursiveOrch/RecursiveOrch.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123953"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=123953" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/123953.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/07/23/recursiveorchestration.aspx</guid>
            <pubDate>Wed, 23 Jul 2008 05:44:49 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/123953.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/07/23/recursiveorchestration.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/123953.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/123953.aspx</trackback:ping>
        </item>
        <item>
            <title>WCF Latency Test Harness and WCF Performance</title>
            <link>http://geekswithblogs.net/BVeldhoen/archive/2008/01/26/wcf-latency-test-harness.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;On performance measurements in general&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Performance measurements are highly sensitive to details. One implementation detail can have a huge impact. The performance measurement results, posted here, apply to the implementation, that was used to generate the measurements. You can find the link to that implementation, the WCF Test Harness code (on codeplex), below.&lt;/p&gt;
&lt;p&gt;The main reasons to blog about the performance measurement results is to receive feedback and validation of the results by others, who are also interested in it, and to verify that the implementation doesn't contain any issues that might invalidate the results. If you find anything wrong with the code, have trouble reproducing, etc., pls. leave a comment and I'll get back to it asap.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Throughput vs Latency&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The implementation of the WCF Latency Test Harness is focussed on the latency of a range of methods, implemented by a WCF service and called by a WCF client. For throughput measurement on WCF services, pls. go to &lt;a href="http://msdn2.microsoft.com/en-us/library/bb310550.aspx"&gt;this Microsoft whitepaper&lt;/a&gt;&lt;font face="Arial"&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Variations during the performance tests&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The WCF Latency Test Harness allows to measure the latency of WCF whilst varying the following parameters:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Test scope: Direct, SameAppDomain, SameProcess, SameMachine, Remote &lt;/li&gt;
    &lt;li&gt;Bindings: nullTransport, netNamedPipe, netTcp, netMsmq, basicHttp, wsHttp (and .NET Remoting). &lt;/li&gt;
    &lt;li&gt;instancingModes: Single, PerSession, PerCall &lt;/li&gt;
    &lt;li&gt;Serializers: DataContractSerializer (DefaultSF (for Remoting, this is the BinaryFormatter)), PreserveObjectReferencesDataContractSerializer (PORDCSF), NetDataContractSerializer (NDCSF), XmlSerializer (XMLSF)  &lt;/li&gt;
    &lt;li&gt;CallModes: OneWay, TwoWay &lt;/li&gt;
    &lt;li&gt;ReceiveDataMethods: several methods are implemented, each using a different data type for the data to be transferred, ranging from byte[], string, Stream to more complex data structures. &lt;/li&gt;
    &lt;li&gt;DataSizes: size of the used data type/data structure to be transferred. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You'll find enums for most of the parameters above in the implementation (if not already provided by the .NET Framework). Most of these parameters can be manipulated by changing the configuration only.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Overview of measurement method&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Before the tests start, the appropriate configuration files are copied to the service and client private application paths. The service is self-hosted and loads the configuration from those copied files.&lt;/p&gt;
&lt;p&gt;The implementation contains a WCF service, which exposes a number of methods via a ServiceContract and DataContract. It also contains a WCF client, which calls the WCF service methods within a loop.&lt;/p&gt;
&lt;p&gt;The latency measurements of the WCF service methods are done using the System.Diagnostics.Stopwatch. The client call to the WCF service is synchronized (even in a OneWay scenario) by using a 2nd WCF netTcp service, hosted by the client, which receives the receipt signal of the service. There is never more than one call on the service at any one time. This also means that the queueing mechanism of WCF is not tested to the full extent. Since the aim of the WCF Latency Test Harness is to measure the latency, this is acceptable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Data structures&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In order to test methods with different parameters, the following data structures were used.&lt;/p&gt;
&lt;p&gt;&lt;img height="193" alt="" width="811" src="/images/geekswithblogs_net/BVeldhoen/DataStructures(1).jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Member variables data types:&lt;/p&gt;
&lt;p&gt;Data: byte[] of size DataSize.&lt;/p&gt;
&lt;p&gt;Text: string of size DataSize.&lt;/p&gt;
&lt;p&gt;AdvancedContainer.Containers: AdvancedContainer[].&lt;/p&gt;
&lt;p&gt;AdvancedTextContainer.Containers: AdvancedTextContainer[].&lt;/p&gt;
&lt;p&gt;In the tests with the AdvancedContainer and AdvancedTextContainer data structures, an object hierarchy of 1x3x3 was used (One parent, three children, with each three children), resulting in a memory footprint of about 10x the footprint of the SimpleContainer and SimpleTextContainer (for the same DataSize).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customizing the WCF Latency Test Harness&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Additional bindings can be tested by adding some configuration, including binding configuration. Testing the impact of configuration settings can be done by changing the binding configuration file. For other additions or changes (additional data structures, etc.), changes to the code are necessary.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Security&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;WCF is secure by default. In the WCF Latency Test Harness implementation, in the default configuration (RequestedBindingConfigTags=Default), all security has been disabled for the WCF bindings. The impact of enabled security can be tested by adjusting the configuration files and configuring certificates etc. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Test parameter combinations&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Some combinations of the test parameters above just don't fly, or weren't implemented due to other reasons:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;netMsmq and TwoWay. WCF enforces that methods are decorated with the OneWay=true OperationContractAttribute parameter in a netMsmq scenario. &lt;/li&gt;
    &lt;li&gt;netMsmq and PerSession. &lt;/li&gt;
    &lt;li&gt;.NET Remoting and other-than DefaultSF Serializer. .NET Remoting uses the BinaryFormatter, while the other WCF Bindings use the default DataContract serializer. Hence the term "DefaultSF" (Default Serializer Format). &lt;/li&gt;
    &lt;li&gt;nullTransport and other-than SameAppDomain test scope. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Target system specifications&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The measurements were performed on the following system:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Intel Core 2 Duo E4500 2.20 GHz CPU &lt;/li&gt;
    &lt;li&gt;2.0 Gb RAM &lt;/li&gt;
    &lt;li&gt;32-bit Vista Business, .NET 3.5 &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Results&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Results were generated using &lt;a href="http://www.codeplex.com/WCFLatencyTstHarness/SourceControl/DownloadSourceCode.aspx?changeSetId=5849"&gt;Changeset 5849&lt;/a&gt; of the source code.&lt;/p&gt;
&lt;p&gt;The raw data of the graphs, presented below, can be found in the file SameAppDomain.Single.zip &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=WCFLatencyTstHarness&amp;amp;ReleaseId=10230"&gt;here&lt;/a&gt;.&lt;font face="Arial"&gt; This file also contains the configuration files, used to produce these results, and the performance counter log output (CPU usage etc.).&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;N.B. All graphs are with double logarithmic scales.&lt;/p&gt;
&lt;p&gt;&lt;img height="380" alt="" width="616" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.TwoWay.DefaultSF.ReceiveData.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;&lt;img height="369" alt="" width="606" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.OneWay.DefaultSF.ReceiveData.jpg" /&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;img alt="" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.OneWay.NDCSF.ReceiveData.jpg" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="380" alt="" width="648" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.OneWay.PORDCSF.ReceiveData.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="363" alt="" width="594" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.OneWay.XMLSF.ReceiveData.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Time for some text here:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;basicHttp and wsHttp performed equally. We haven't been using any of the ws specific settings, so that probably explains a lot :). &lt;/li&gt;
    &lt;li&gt;nullTransport, netNamedPipe and netMsmq seemed to converge for large DataSizes (10&lt;sup&gt;6&lt;/sup&gt;+ bytes). &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img height="377" alt="" width="663" src="/images/geekswithblogs_net/BVeldhoen/REAL/SameAppDomain.Single.OneWay.ReceiveAC.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;In the last graph, we see the effect that .NET Remoting outperforms netTcp using the default DataContractSerializer when using a more complex data structure. A detailed discussion and explanation can be found &lt;a href="http://blogs.microsoft.co.il/blogs/sasha/archive/2008/01/20/wonders-with-wcf-s-datacontractserializer.aspx"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Streaming and WCF TransferMode&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="376" alt="" width="596" src="/images/geekswithblogs_net/BVeldhoen/Streaming/netTcp.TwoWay.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="358" alt="" width="596" src="/images/geekswithblogs_net/BVeldhoen/Streaming/netTcp.OneWay(1).jpg" /&gt;&lt;/p&gt;
&lt;p&gt;In a TwoWay or buffered scenario, the difference between ReceiveData and ReceiveStream was negligible. In a OneWay Streamed scenario, using the transferMode=Streamed setting was beneficial at DataSizes &amp;gt; 10,000.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Performance Counters (CPU Usage)&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The performance counters to be logged during the measurements with the WCF Latency Test Harness can be configured in one of the configuration files by adding the logman.exe/perfmon.exe compatible performance counter name.&lt;/p&gt;
&lt;p&gt;&lt;img height="386" alt="" width="644" src="/images/geekswithblogs_net/BVeldhoen/PerformanceCounters/CPU Usage netNamedPipe.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="390" alt="" width="644" src="/images/geekswithblogs_net/BVeldhoen/PerformanceCounters/CPU Usage netTcp.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="366" alt="" width="552" src="/images/geekswithblogs_net/BVeldhoen/PerformanceCounters/CPU Usage basicHttp.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img height="379" alt="" width="565" src="/images/geekswithblogs_net/BVeldhoen/PerformanceCounters/CPU Usage Remoting.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;The above graphs show that the CPU usage was lower than 100% at all times during the measurements, which indicates that the latency measurements were performed correctly regarding the total system load, as latency may degrade when the total CPU usage nears 100%. Such a scenario (near-100% CPU usage) would be appropriate for throughput measurements, but not for latency measurements).&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;strong&gt;Source code&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&lt;a href="http://www.codeplex.com/WCFLatencyTstHarness"&gt;http://www.codeplex.com/WCFLatencyTstHarness&lt;/a&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Further measurements&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Other measurements, that were not performed, but seem interesting:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Other OS: XP, 64-bit Vista &lt;/li&gt;
    &lt;li&gt;Bindings configured to use transport and/or message security &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Acknowledgements&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The following people have contributed to the WCF Latency Test Harness:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="http://www.linkedin.com/pub/1/124/942"&gt;Ilan Tavor&lt;/a&gt; (&lt;a href="http://www.kla-tencor.com"&gt;KLA-Tencor&lt;/a&gt;, making it possible) &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/alon/"&gt;Alon Fliess&lt;/a&gt; (technical guidance) &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://www.geocities.com/SiliconValley/5280/"&gt;Sasha Goldshtein&lt;/a&gt; (technical input on &lt;a href="http://blogs.microsoft.co.il/blogs/sasha/archive/2008/01/20/wonders-with-wcf-s-datacontractserializer.aspx"&gt;the serialization aspects&lt;/a&gt;; Kudos!) &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://geekswithblogs.net/JoshReuben/Default.aspx"&gt;Josh Reuben&lt;/a&gt; (general technical input) &lt;/li&gt;
    &lt;li&gt;&lt;a href="http://blogs.microsoft.co.il/blogs/applisec/"&gt;Manu Cohen-Yashar&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118952"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=118952" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/BVeldhoen/aggbug/118952.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Bram Veldhoen</dc:creator>
            <guid>http://geekswithblogs.net/BVeldhoen/archive/2008/01/26/wcf-latency-test-harness.aspx</guid>
            <pubDate>Sat, 26 Jan 2008 22:14:02 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/BVeldhoen/comments/118952.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/BVeldhoen/archive/2008/01/26/wcf-latency-test-harness.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/BVeldhoen/comments/commentRss/118952.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/BVeldhoen/services/trackbacks/118952.aspx</trackback:ping>
        </item>
    </channel>
</rss>