<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BizTalk Blog</title>
	<atom:link href="http://blog.biztalk-info.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.biztalk-info.com</link>
	<description>My experiences (mistakes) with BizTalk</description>
	<lastBuildDate>Fri, 18 May 2012 01:41:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>EDI Assembly Pipeline Component&#8211;Object reference not set to an instance of an object</title>
		<link>http://blog.biztalk-info.com/2012/05/edi-assembly-pipeline-componentobject-reference-not-set-to-an-instance-of-an-object/</link>
		<comments>http://blog.biztalk-info.com/2012/05/edi-assembly-pipeline-componentobject-reference-not-set-to-an-instance-of-an-object/#comments</comments>
		<pubDate>Fri, 18 May 2012 01:41:34 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=364</guid>
		<description><![CDATA[So I was working with a co-worker over the past week or so creating the following process: Each trading partner (including the same one who got two) receives an interchange of EDI 835 payment advices. So he had created the map and was getting the interchange xml output out of the orchestration where the map <a href='http://blog.biztalk-info.com/2012/05/edi-assembly-pipeline-componentobject-reference-not-set-to-an-instance-of-an-object/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So I was working with a co-worker over the past week or so creating the following process:</p>
<p align="center"><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image_thumb2.png" width="567" height="435" /></a></p>
<p>Each trading partner (including the same one who got two) receives an interchange of EDI 835 payment advices. </p>
<p>So he had created the map and was getting the interchange xml output out of the orchestration where the map lives. However, every time he would attempt to send it through the EDI send pipeline, it would dehydrate stating that the object reference not set to an instance of an object. I searched high and low (and by that I mean that I went to multiple pages in my Google search).</p>
<p>So my co-worker had taken a day off and I was going &#8216;<em>supposed</em>’ to work on it. I was working on a few other things and knew that I wouldn’t get to it. The night before he took the day off, I knew exactly what the problem was, and I ended up having to think about the fix for an entire 36 hours (<strong><em>torture</em></strong>).</p>
<p>Resolution: We had created a partner specific 835 schema with a target namespace of <a href="http://schema.company.com">http://schema.company.com</a> instead of <a href="http://schema.microsoft.com">http://schema.microsoft.com</a>. We had even gone into the agreement settings and set the schema from <a href="http://schema.microsoft.com">http://schema.microsoft.com</a> to <a href="http://schema.company.com">http://schema.company.com</a>. His map was creating (via pure xsl) the interchange message with the transaction’s namespace set to <a href="http://schema.microsoft.com">http://schema.microsoft.com</a>. Well, when the EDI assembler received the xml version of the transactions, it went to the GAC to find the 835 schema with the target namespace of <a href="http://schema.microsoft.com">http://schema.microsoft.com</a> (this object is referencing), however, we didn’t have the default 835 schema deployed. This meant that the EDI assembler was referencing an instance of an object. (It didn’t lie after all). Once we changed the map to create transactions with the target namespace with <a href="http://schema.company.com">http://schema.company.com</a> did it run through without fail.</p>
<p>Now we have a process that runs in seconds, no batching, maintains the order of claim payment advices by order of the Header record. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/05/edi-assembly-pipeline-componentobject-reference-not-set-to-an-instance-of-an-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BRE Resolver&#8211;Typed Message Microsoft.Practices.ESB.ResolveProviderMessage</title>
		<link>http://blog.biztalk-info.com/2012/05/bre-resolvertyped-message-microsoft-practices-esb-resolveprovidermessage/</link>
		<comments>http://blog.biztalk-info.com/2012/05/bre-resolvertyped-message-microsoft-practices-esb-resolveprovidermessage/#comments</comments>
		<pubDate>Fri, 18 May 2012 01:41:17 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=360</guid>
		<description><![CDATA[So I was assisting Brian last night put the Business Rule Engine in front of the ESB solution, so it could determine which itinerary to run. I had just completed getting a flow through the ESB myself. So, after some correction of spelling mistakes (come on code, don’t be so picky about absolutely needing strings <a href='http://blog.biztalk-info.com/2012/05/bre-resolvertyped-message-microsoft-practices-esb-resolveprovidermessage/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So I was assisting Brian last night put the Business Rule Engine in front of the ESB solution, so it could determine which itinerary to run. I had just completed getting a flow through the ESB myself. So, after some correction of spelling mistakes (<em>come on code, don’t be so picky about absolutely needing strings to be match exactly, do what I want, not what I say</em>), we got down to the guts of why things aren’t working.</p>
<p>We implemented the BRE Policy, tested the message: right clicked the policy and chose test: viola, it worked. However, when we ran it through the Itinerary Selector pipeline component we kept getting an error stating that Itinerary_getitinerary required the parameter @name which was not provided. </p>
<p>The issue is that the folks at Microsoft (or subcontractors paid to do the work for them) put the following code in the Business Rule Engine resolver:</p>
<p>Notice that the TypedXMLDocument that will be submitted to the BRE will <em>always</em> be Microsoft.Practices.ESB.ResolveProviderMessage.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:2fbb74e5-a47e-4f88-9006-1330db927107" class="wlWriterEditableSmartContent">
<pre style=" width: 1542px; height: 500px;background-color:White;overflow: visible;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #000000;">    </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> Dictionary</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">, </span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> ResolveRules(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> config, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> resolver, XmlDocument message, Resolution resolution, Microsoft.Practices.ESB.Resolver.BRE.BRE bre)
    {
      Dictionary</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">, </span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> dictionary3;
      </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> majorRevision </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;
      </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> minorRevision </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;
      Policy policy </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
      Dictionary</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">, </span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> dictionary </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
      </span><span style="color: #0000FF;">string</span><span style="color: #000000;">[] strArray </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
      </span><span style="color: #0000FF;">object</span><span style="color: #000000;">[] facts </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
      TypedXmlDocument document </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
      </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> documentType </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Microsoft.Practices.ESB.ResolveProviderMessage</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
      Dictionary</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">, </span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> resolverDictionary </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Dictionary</span><span style="color: #000000;">&lt;</span><span style="color: #0000FF;">string</span><span style="color: #000000;">, </span><span style="color: #0000FF;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">();
      </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">resolver.Contains(</span><span style="color: #800000;">@&quot;</span><span style="color: #800000;">:\</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
      {
        resolver </span><span style="color: #000000;">=</span><span style="color: #000000;"> resolver </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">@&quot;</span><span style="color: #800000;">:\</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
      }
      </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
      {
      ...
      }
     }
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>So how do you create your Business Rules so it adheres to this type of TypedXmlDocument?</p>
<p>When you import a schema to create a vocabulary or use directly within a policy, you will need to change the following property:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image_thumb.png" width="333" height="437" /></a> &#8216;</p>
<p>To look like this:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image1.png"><img style="background-image: none; border-right-width: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/05/image_thumb1.png" width="397" height="436" /></a></p>
<p>Go ahead and use the xml document all you want!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/05/bre-resolvertyped-message-microsoft-practices-esb-resolveprovidermessage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Management Console Timing Out</title>
		<link>http://blog.biztalk-info.com/2012/04/management-console-timing-out/</link>
		<comments>http://blog.biztalk-info.com/2012/04/management-console-timing-out/#comments</comments>
		<pubDate>Thu, 26 Apr 2012 01:11:32 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=350</guid>
		<description><![CDATA[Have you ever needed to query through the BizTalk Management Console and find some messages that are tracked, but the console keeps timing out? Here is a query that you can run: use [BizTalkDTADb] GO set DEADLOCK_PRIORITY LOW SELECT TOP 1000 ms.strStatus AS [Event Type], svcs.strServiceName AS [Service Name], tr.strAdapter AS [Adapter], mioe.strUrl AS [URI], <a href='http://blog.biztalk-info.com/2012/04/management-console-timing-out/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever needed to query through the BizTalk Management Console and find some messages that are tracked, but the console keeps timing out?</p>
<p>Here is a query that you can run:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:46974c79-f059-429a-9b93-d25f98981807" class="wlWriterEditableSmartContent">
<pre style=" width: 1126px; height: 825px;background-color:White;overflow: visible;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">use</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">BizTalkDTADb</span><span style="color: #FF0000;">]</span><span style="color: #000000;">
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">set</span><span style="color: #000000;"> DEADLOCK_PRIORITY LOW
</span><span style="color: #0000FF;">SELECT</span><span style="color: #000000;"> </span><span style="color: #0000FF;">TOP</span><span style="color: #000000;"> </span><span style="color: #800000; font-weight: bold;">1000</span><span style="color: #000000;">
ms.strStatus </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Event Type</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
svcs.strServiceName </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Service Name</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
tr.strAdapter </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Adapter</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.strUrl </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">URI</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
sn.strSchemaName </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Schema Name</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
po.strPortName </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Port Name</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
</span><span style="color: #FF00FF;">DATEADD</span><span style="color: #000000;">(MI, </span><span style="color: #FF00FF;">DATEDIFF</span><span style="color: #000000;">(MI,GETUTCDATE(),</span><span style="color: #FF00FF;">GETDATE</span><span style="color: #000000;">()), mioe.dtTimestamp) </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Timestamp</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.nPartCount </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Part Count</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.nMessageSize </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Size</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
ds.strDecryptionSubject </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Decryption Certificate</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
ss.strSigningSubject </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Signature</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
pn.strPartyName </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Party Name</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.uidActivityId </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Activity ID</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.uidMessageInstanceId </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Message Instance ID</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
mioe.uidServiceInstanceId </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Service Instance ID</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
si.uidServiceClassId </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Service Class ID</span><span style="color: #FF0000;">]</span><span style="color: #000000;">,
svcs.strServiceType </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Service Class</span><span style="color: #FF0000;">]</span><span style="color: #000000;">
</span><span style="color: #0000FF;">FROM</span><span style="color: #000000;"> dta_SchemaName sn
</span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_MessageInOutEvents</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> mioe </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> mioe.nSchemaId </span><span style="color: #808080;">=</span><span style="color: #000000;"> sn.nSchemaId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_Adapter</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> tr </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> tr.nAdapterId </span><span style="color: #808080;">=</span><span style="color: #000000;"> mioe.nAdapterId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_MessageStatus</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> ms </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> mioe.nStatus </span><span style="color: #808080;">=</span><span style="color: #000000;"> ms.nMessageStatusId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_DecryptionSubject</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> ds </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> ds.nDecryptionSubjectId </span><span style="color: #808080;">=</span><span style="color: #000000;"> mioe.nDecryptionSubjectId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_SigningSubject</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> ss </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> ss.nSigningSubjectId </span><span style="color: #808080;">=</span><span style="color: #000000;"> mioe.nSigningSubjectId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_PartyName</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> pn </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> pn.nPartyId </span><span style="color: #808080;">=</span><span style="color: #000000;"> mioe.nPartyId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_ServiceInstances</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> si </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> mioe.uidServiceInstanceId </span><span style="color: #808080;">=</span><span style="color: #000000;"> si.uidServiceInstanceId
</span><span style="color: #808080;">AND</span><span style="color: #000000;"> mioe.uidActivityId </span><span style="color: #808080;">=</span><span style="color: #000000;"> si.uidActivityId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_Services</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> svcs </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> si.uidServiceId </span><span style="color: #808080;">=</span><span style="color: #000000;"> svcs.uidServiceId
</span><span style="color: #808080;">LEFT</span><span style="color: #000000;"> </span><span style="color: #808080;">JOIN</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dbo</span><span style="color: #FF0000;">]</span><span style="color: #000000;">.</span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">dta_PortName</span><span style="color: #FF0000;">]</span><span style="color: #000000;"> po </span><span style="color: #0000FF;">ON</span><span style="color: #000000;"> po.nPortId </span><span style="color: #808080;">=</span><span style="color: #000000;"> mioe.nPortId
</span><span style="color: #008080;">--</span><span style="color: #008080;">Put the port name that you want to look at here:</span><span style="color: #008080;">
</span><span style="color: #0000FF;">WHERE</span><span style="color: #000000;"> </span><span style="color: #FF00FF;">CAST</span><span style="color: #000000;">(po.strPortName </span><span style="color: #0000FF;">AS</span><span style="color: #000000;"> </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #800000; font-weight: bold;">4000</span><span style="color: #000000;">)) </span><span style="color: #808080;">=</span><span style="color: #000000;"> </span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">Meditech Port</span><span style="color: #FF0000;">'</span><span style="color: #000000;">
</span><span style="color: #0000FF;">ORDER</span><span style="color: #000000;"> </span><span style="color: #0000FF;">BY</span><span style="color: #000000;"> mioe.dtTimestamp </span><span style="color: #0000FF;">DESC</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p><a href="http://blogs.msdn.com/b/biztalk_core_engine/archive/2007/01/04/what-you-can-and-can-t-do-with-the-messagebox-database-server.aspx" target="_blank">Did I tell you that you should not be doing this? YOU SHOULDN’T!!!!!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/management-console-timing-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Executing a dynamic query from multiple tables</title>
		<link>http://blog.biztalk-info.com/2012/04/executing-a-dynamic-query-from-multiple-tables/</link>
		<comments>http://blog.biztalk-info.com/2012/04/executing-a-dynamic-query-from-multiple-tables/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 10:34:39 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=346</guid>
		<description><![CDATA[How do you query BAMArchive data? The tables that are created are time stamped. A friend asked me about this, so I thought I would put a little example out there for everyone to see. With the BAMarchive, all of the columns are the same (for a particular activity), so all I really need to <a href='http://blog.biztalk-info.com/2012/04/executing-a-dynamic-query-from-multiple-tables/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><font style="font-weight: normal" size="2">How do you query BAMArchive data? The tables that are created are time stamped.      <br />A friend asked me about this, so I thought I would put a little example out there for everyone to see.       <br />With the BAMarchive, all of the columns are the same (for a particular activity), so all I really need to do is UNION ALL the data.       <br />(Oh this query has to be run against the database that the tables live)</font></p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:f644217e-0ce9-4148-b4b0-07bac85c8a63" class="wlWriterEditableSmartContent">
<pre style=" width: 954px; height: 1017px;background-color:White;overflow: visible;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">use</span><span style="color: #000000;"> BAMArchive
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">

</span><span style="color: #008080;">--</span><span style="color: #008080;">Create all of the tables</span><span style="color: #008080;">
</span><span style="color: #0000FF;">create</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_1 (data </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #800000; font-weight: bold;">100</span><span style="color: #000000;">))
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">create</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_2 (data </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #800000; font-weight: bold;">100</span><span style="color: #000000;">))
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">create</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_3 (data </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #800000; font-weight: bold;">100</span><span style="color: #000000;">))
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">create</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_4 (data </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #800000; font-weight: bold;">100</span><span style="color: #000000;">))
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">

</span><span style="color: #008080;">--</span><span style="color: #008080;">Insert some data into each table</span><span style="color: #008080;">
</span><span style="color: #0000FF;">insert</span><span style="color: #000000;"> </span><span style="color: #0000FF;">into</span><span style="color: #000000;"> Table_1
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">data for table 1</span><span style="color: #FF0000;">'</span><span style="color: #000000;">
</span><span style="color: #0000FF;">insert</span><span style="color: #000000;"> </span><span style="color: #0000FF;">into</span><span style="color: #000000;"> Table_2
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">data for table 2</span><span style="color: #FF0000;">'</span><span style="color: #000000;">
</span><span style="color: #0000FF;">insert</span><span style="color: #000000;"> </span><span style="color: #0000FF;">into</span><span style="color: #000000;"> Table_3
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">data for table 3</span><span style="color: #FF0000;">'</span><span style="color: #000000;">
</span><span style="color: #0000FF;">insert</span><span style="color: #000000;"> </span><span style="color: #0000FF;">into</span><span style="color: #000000;"> Table_4
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">data fro table 4</span><span style="color: #FF0000;">'</span><span style="color: #000000;">

</span><span style="color: #008080;">--</span><span style="color: #008080;">Here is the actual work</span><span style="color: #008080;">
</span><span style="color: #0000FF;">declare</span><span style="color: #000000;"> </span><span style="color: #008000;">@statement</span><span style="color: #000000;"> </span><span style="color: #0000FF;">nvarchar</span><span style="color: #000000;">(</span><span style="color: #FF00FF;">max</span><span style="color: #000000;">)
</span><span style="color: #0000FF;">set</span><span style="color: #000000;"> </span><span style="color: #008000;">@statement</span><span style="color: #808080;">=</span><span style="color: #FF0000;">''</span><span style="color: #000000;">
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #008000;">@statement</span><span style="color: #808080;">=</span><span style="color: #008000;">@statement</span><span style="color: #808080;">+</span><span style="color: #FF0000;">'</span><span style="color: #FF0000;">select data from </span><span style="color: #FF0000;">'</span><span style="color: #808080;">+</span><span style="color: #000000;"> name </span><span style="color: #808080;">+</span><span style="color: #FF0000;">'</span><span style="color: #FF0000;"> union all </span><span style="color: #FF0000;">'</span><span style="color: #000000;">
</span><span style="color: #0000FF;">from</span><span style="color: #000000;"> sys.tables
</span><span style="color: #008080;">--</span><span style="color: #008080;">Only get the tables that were created within the past day</span><span style="color: #008080;">
--</span><span style="color: #008080;">but here you would want to include the activity name</span><span style="color: #008080;">
</span><span style="color: #0000FF;">where</span><span style="color: #000000;"> create_date </span><span style="color: #808080;">&gt;</span><span style="color: #000000;"> </span><span style="color: #FF00FF;">dateadd</span><span style="color: #000000;">(d,</span><span style="color: #808080;">-</span><span style="color: #800000; font-weight: bold;">1</span><span style="color: #000000;">,</span><span style="color: #FF00FF;">GETDATE</span><span style="color: #000000;">())
</span><span style="color: #008080;">--</span><span style="color: #008080;">Remove the last union all</span><span style="color: #008080;">
</span><span style="color: #0000FF;">set</span><span style="color: #000000;"> </span><span style="color: #008000;">@statement</span><span style="color: #808080;">=</span><span style="color: #FF00FF;">substring</span><span style="color: #000000;">(</span><span style="color: #008000;">@statement</span><span style="color: #000000;">,</span><span style="color: #800000; font-weight: bold;">0</span><span style="color: #000000;">,</span><span style="color: #FF00FF;">len</span><span style="color: #000000;">(</span><span style="color: #008000;">@statement</span><span style="color: #000000;">)</span><span style="color: #808080;">-</span><span style="color: #800000; font-weight: bold;">9</span><span style="color: #000000;">)
</span><span style="color: #008080;">--</span><span style="color: #008080;">Show the query we are about to run</span><span style="color: #008080;">
</span><span style="color: #0000FF;">select</span><span style="color: #000000;"> </span><span style="color: #008000;">@statement</span><span style="color: #000000;"> </span><span style="color: #FF0000;">[</span><span style="color: #FF0000;">Query</span><span style="color: #FF0000;">]</span><span style="color: #000000;">
</span><span style="color: #008080;">--</span><span style="color: #008080;">Actually run the statement</span><span style="color: #008080;">
</span><span style="color: #0000FF;">exec</span><span style="color: #000000;"> (</span><span style="color: #008000;">@statement</span><span style="color: #000000;">)

</span><span style="color: #008080;">--</span><span style="color: #008080;">dropping tables so you can run the query again</span><span style="color: #008080;">
</span><span style="color: #0000FF;">drop</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_1
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">drop</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_2
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">drop</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_3
</span><span style="color: #0000FF;">GO</span><span style="color: #000000;">
</span><span style="color: #0000FF;">drop</span><span style="color: #000000;"> </span><span style="color: #0000FF;">table</span><span style="color: #000000;"> Table_4
</span><span style="color: #0000FF;">GO</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/executing-a-dynamic-query-from-multiple-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What happened when the BRE fired in BizTalk?</title>
		<link>http://blog.biztalk-info.com/2012/04/what-happened-when-the-bre-fired-in-biztalk/</link>
		<comments>http://blog.biztalk-info.com/2012/04/what-happened-when-the-bre-fired-in-biztalk/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 06:28:41 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=340</guid>
		<description><![CDATA[I am writing this as a personal reminder on how to watch a BRE rule fire in BizTalk. In the management console, go to the application you are working in and right click the policies and in the window click refresh. Right click and and add and choose the policies you want to track. Here <a href='http://blog.biztalk-info.com/2012/04/what-happened-when-the-bre-fired-in-biztalk/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I am writing this as a personal reminder on how to watch a BRE rule fire in BizTalk.</p>
<p>In the management console, go to the application you are working in and right click the policies and in the window click refresh.</p>
<p>Right click and and add and choose the policies you want to track.</p>
<p>Here are the various policies that I have been debugging:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image9.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb9.png" width="601" height="557" /></a></p>
<p>(Yes, I know, I can set the endpoint configuration correctly on the first try (see my <a href="http://blog.biztalk-info.com/2012/04/some-esb-2-1-hints/" target="_blank">hints page</a>), but I can’t determine the map to call to save my life!)</p>
<p>Restart the Host Instances</p>
<p>Run the process though and look at the Tracked Service Instances,&#160; right click on the <strong>Message Flow</strong></p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image10.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb10.png" width="1038" height="656" /></a></p>
<p>Click on the Follow this link to view the Policy execution details for this Orchestration Instance.</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image11.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb11.png" width="565" height="290" /></a></p>
<p>Voilà</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/what-happened-when-the-bre-fired-in-biztalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some ESB 2.1 Hints</title>
		<link>http://blog.biztalk-info.com/2012/04/some-esb-2-1-hints/</link>
		<comments>http://blog.biztalk-info.com/2012/04/some-esb-2-1-hints/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 06:11:23 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=332</guid>
		<description><![CDATA[So Joe and I were talking and I was showing what I was doing, and he said I should be blogging about this since it doesn’t appear to be documented anywhere. The resolver I made is a separate one so it can work on getting the endpoint configuration. Here are the steps I used to <a href='http://blog.biztalk-info.com/2012/04/some-esb-2-1-hints/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So Joe and I were talking and I was showing what I was doing, and he said I should be blogging about this since it doesn’t appear to be documented anywhere.</p>
<p>The resolver I made is a separate one so it can work on getting the endpoint configuration. Here are the steps I used to configure the endpoint in the Itinerary Designer.</p>
<ul>
<li>Created the service schemas using the Visual Studio WCF Wizard </li>
<li>Created the map that creates the request message </li>
<li>Opened the binding file that is created as part of the project </li>
<li>Set the Resolver to Static and set the adapter to the appropriate binding (WCF-BasicHttp in my example) </li>
</ul>
<p>Enter the following values:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb4.png" width="1853" height="863" /></a></p>
<p>On the Endpoint Configuration:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb5.png" width="1772" height="817" /></a></p>
<p>So now you have everything set in the Endpoint configuration.</p>
<p>Now to move all of the settings to the BRE:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb6.png" width="1466" height="457" /></a></p>
<p>So how do you get the Endpoint Configuration into the Set End Point Configuration to section? Simply highlight the value in the Endpoint Configuration and copy (control-c) and go the BRE and paste</p>
<p>Publish and Deploy</p>
<p>Set the Resolver to BRE</p>
<p>Choose the Policy from the drop-down</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb7.png" width="521" height="304" /></a></p>
<p>Voilà</p>
<p>The second tip is how to refer to XPath directly in the BRE from the BRE resolver</p>
<p>When you refer to a schema, make sure you click on the root node and change the Document Type to <strong>Microsoft.Practices.ESB.ResolveProviderMessage</strong> and now you can drag the attributes/elements into your rules with confidence that the rule will fire. (Make sure you type the Document Type correctly <em>Microsoft.EDB.ResolveProviderMessage</em> will cause the rule not to fire <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smilewithtongueout" alt="Smile with tongue out" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/wlEmoticon-smilewithtongueout.png" />)</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image8.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb8.png" width="432" height="336" /></a></p>
<p>Voilà deux</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/some-esb-2-1-hints/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhancements to the ESB Toolkit</title>
		<link>http://blog.biztalk-info.com/2012/04/enhancements-to-the-esb-toolkit/</link>
		<comments>http://blog.biztalk-info.com/2012/04/enhancements-to-the-esb-toolkit/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 05:14:27 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=317</guid>
		<description><![CDATA[First: The ESB Toolkit 2.1 SUCKS Compared to version 2.0, it appears to be compiled for .Net 4 (that is it), however all of the projects are still set to .Net 3.5 It used to be the ESB Guidance 1.0 so you can ‘extend’ it. However, there is no source code to do that anymore. <a href='http://blog.biztalk-info.com/2012/04/enhancements-to-the-esb-toolkit/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>First:</p>
<p>The ESB Toolkit 2.1 <strong>SUCKS</strong></p>
<ul>
<li>Compared to version 2.0, it appears to be compiled for .Net 4 (that is it), however all of the projects are still set to .Net 3.5 </li>
<li>It used to be the ESB Guidance 1.0 so you can ‘extend’ it. However, there is no source code to do that anymore. If I wanted to change some behavior of a pipeline, I am screwed, I can download 1.0 and take a look at how it is done (or I can reverse engineer the current pipelines), but without doing a ton of work, it is not very extendable. </li>
<li>Calling into support is nearly a waste of time, okay: <em>more than nearly</em>. </li>
</ul>
<p>Second:</p>
<p>There are a few deficiencies I have found with ESB 2.1:</p>
<ul>
<li>The itinerary designer can query various databases (management db, rules engine db) to allow drop downs in the property window to choose things that were deployed. EXCEPT: orchestrations. For this, you have to go edit a configuration file, and restart visual studio (or if you really have some stones: unload a section in SSO make additions, and then reload it, using a nearly undocumented command line) </li>
<li>The entire design of the ESB solution <strong><em>assumes</em></strong> that each service you call responds with all of the data that you need to go to the next service that will be called.
<ul>
<li><em>WHAT?!</em> First of all, a lot of services out there only return the value it needs to return, not the original payload coupled with the new value. </li>
<li>Many, if not all services can’t be re-engineered to change the behavior, as a lot of them are managed by an outside vendor. </li>
</ul>
</li>
<li>The ESB Portal has to run in compatibility mode, even in IE8. </li>
<li>If you want to re-submit messages back into the message box, all of the context properties are GONE. Essentially, resubmittal is A TOTAL WASTE. </li>
</ul>
<p>So, I have made a few changes to accomplish what I think are a couple fundamental changes to make the ESB toolkit usable.</p>
<p>First: I changed the behavior of the resubmittal process: here is the code I added to the portal: </p>
<p>(notice the source that is provided is for which version?)</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:f5a464dc-0360-4627-a205-b52089f08b8a" class="wlWriterEditableSmartContent">
<pre style=" width: 1427px; height: 1215px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #008000;">//</span><span style="color: #008000;">---------------------------------------------------------------------
</span><span style="color: #008000;">//</span><span style="color: #008000;"> File: MessageViewer.aspx.cs
</span><span style="color: #008000;">//</span><span style="color: #008000;">
</span><span style="color: #008000;">//</span><span style="color: #008000;"> Summary: This page displays the details of a message.  It renders the message body
</span><span style="color: #008000;">//</span><span style="color: #008000;">          if it is an XML or flat file.  Otherwise if allows the message
</span><span style="color: #008000;">//</span><span style="color: #008000;">          body to be downloaded.
</span><span style="color: #008000;">//</span><span style="color: #008000;">
</span><span style="color: #008000;">//</span><span style="color: #008000;">---------------------------------------------------------------------
</span><span style="color: #008000;">//</span><span style="color: #008000;"> This file is part of the Microsoft ESB Guidance for BizTalk
</span><span style="color: #008000;">//</span><span style="color: #008000;">
</span><span style="color: #008000;">//</span><span style="color: #008000;"> Copyright (c) Microsoft Corporation. All rights reserved.
</span><span style="color: #008000;">//</span><span style="color: #008000;">
</span><span style="color: #008000;">//</span><span style="color: #008000;"> This source code is intended only as a supplement to Microsoft BizTalk
</span><span style="color: #008000;">//</span><span style="color: #008000;"> Server 2006 R2 release and/or on-line documentation. See these other
</span><span style="color: #008000;">//</span><span style="color: #008000;"> materials for detailed information regarding Microsoft code samples.
</span><span style="color: #008000;">//</span><span style="color: #008000;">
</span><span style="color: #008000;">//</span><span style="color: #008000;"> THIS CODE AND INFORMATION ARE PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY
</span><span style="color: #008000;">//</span><span style="color: #008000;"> KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
</span><span style="color: #008000;">//</span><span style="color: #008000;"> IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
</span><span style="color: #008000;">//</span><span style="color: #008000;"> PURPOSE.
</span><span style="color: #008000;">//</span><span style="color: #008000;">----------------------------------------------------------------------</span><span style="color: #008000;">
</span><span style="color: #000000;">
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Data;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Configuration;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Collections;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.Security;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.UI;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.UI.WebControls;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.UI.WebControls.WebParts;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web.UI.HtmlControls;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.ComponentModel;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Net;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.IO;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Text;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Xml;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.ServiceModel;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> ESB.BAM.Service.Implementation;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> ESB.Exceptions.Service.Implementation;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Collections.Generic;

</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> Microsoft.Practices.ESB.Portal
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">partial</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> MessageViewer : System.Web.UI.UserControl
    {
        </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> Properties</span><span style="color: #000000;">

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> True if the message is text based, false otherwise.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> MessageIsText
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> (((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">contentTypeLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text.Contains(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">text</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
                 </span><span style="color: #000000;">||</span><span style="color: #000000;"> ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">contentTypeLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text.Equals(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">application/octet-stream</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">));
            }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Indicates whether a resubmission attempt has been made on the message.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> _resubmitAttempted;
        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> ResubmitAttempted
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> _resubmitAttempted; }
            </span><span style="color: #0000FF;">set</span><span style="color: #000000;"> { _resubmitAttempted </span><span style="color: #000000;">=</span><span style="color: #000000;"> value; }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Indicates whether the message has been successfully resubmitted.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> _resubmitSuccessful;
        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> ResubmitSuccessful
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> _resubmitSuccessful; }
            </span><span style="color: #0000FF;">set</span><span style="color: #000000;"> { _resubmitSuccessful </span><span style="color: #000000;">=</span><span style="color: #000000;"> value; }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Indicated whether the control is allowed to go into edit mode.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> _editModeAvailable;
        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> EditModeAvailable
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> _editModeAvailable; }
            </span><span style="color: #0000FF;">set</span><span style="color: #000000;"> { _editModeAvailable </span><span style="color: #000000;">=</span><span style="color: #000000;"> value; }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Get the selected receive location from the 'receiveLocationList' DropDownlist.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> SelectedReceiveLocation
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).SelectedItem.Text </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Submit to Routing URL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
                {
                    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">RoutingURL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                }
                </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
                {
                    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> ((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).SelectedValue;
                }
            }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Gets the message content type (MIME type).
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> MessageContentType
        {
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">contentTypeLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text; }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> This property indicates whether or not the page is in the mode to
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> edit and resubmit the message.  This is determined by the esb:Mode
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> querystring parameter containing the value: &quot;Edit&quot;.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> _editMode;
        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> EditMode
        {
            </span><span style="color: #0000FF;">set</span><span style="color: #000000;"> { _editMode </span><span style="color: #000000;">=</span><span style="color: #000000;"> value; }
            </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> _editMode; }
        }

        </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">

        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Page_PreRender(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
        {
            SetControlVisibility();
            SetControlEditability();
            RenderMessageBody();

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">IsPostBack)
            {
                PopulateReceiveLocationList();
            }
        }

        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> BindGrid()
        {
            IExceptionService client </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;

</span><span style="color: #0000FF;">try</span><span style="color: #000000;">
            {
                client </span><span style="color: #000000;">=</span><span style="color: #000000;"> PortalHelper.GetExceptionService();

                List</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">usp_select_ContextPropertiesResult</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> contextProperties </span><span style="color: #000000;">=</span><span style="color: #000000;"> client.GetContextProperties(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Guid(Request.QueryString[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">esb:MessageID</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
]));

                contextPropertiesView.DataSource </span><span style="color: #000000;">=</span><span style="color: #000000;"> contextProperties;
                contextPropertiesView.DataBind();
            }

 context;
        }

        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Page_Load(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
        {
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #000000;">IsPostBack)
            {
                IExceptionService client </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                    client </span><span style="color: #000000;">=</span><span style="color: #000000;"> PortalHelper.GetExceptionService();
                    List</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">usp_select_MessagesResult</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> messages </span><span style="color: #000000;">=</span><span style="color: #000000;"> client.GetMessages(Request.QueryString[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">esb:FaultID</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">], Request.QueryString[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">esb:MessageID</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">]);

                    MessageView.DataSource </span><span style="color: #000000;">=</span><span style="color: #000000;"> messages;
                    MessageView.DataBind();

                    BindGrid();
                }

</span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
                {
                    </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> ex;
                }
                </span><span style="color: #0000FF;">finally</span><span style="color: #000000;">
                {
                    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (client </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                    {
                        ((IDisposable)client).Dispose(
);
                    }
                }
            }

            </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode </span><span style="color: #000000;">=</span><span style="color: #000000;"> (Request.QueryString[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">esb:Mode</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">] </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Edit</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

            </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditModeAvailable </span><span style="color: #000000;">=</span><span style="color: #000000;"> (((HtmlInputHidden)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmitSuccessful</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Value </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">True</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
                                          </span><span style="color: #000000;">||</span><span style="color: #000000;"> </span><span style="color: #000000;">!</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageIsText
                                          </span><span style="color: #000000;">||</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode) </span><span style="color: #000000;">?</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;"> : </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
            </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitAttempted </span><span style="color: #000000;">=</span><span style="color: #000000;"> (((HtmlInputHidden)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmitAttempted</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Value </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">True</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
            </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitSuccessful </span><span style="color: #000000;">=</span><span style="color: #000000;"> (((HtmlInputHidden)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmitSuccessful</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Value </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">True</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitSuccessful)
            {
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;img src='../images/severityinformation.gif' style='vertical-align:middle;'/&gt;&amp;nbsp;This message has been successfully resubmitted.</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).ForeColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.Black;
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitAttempted)
            {
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;img src='../images/severitycritical.gif' style='vertical-align:middle;'/&gt;&amp;nbsp;A message resubmission was attempted but failed.</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).ForeColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.Red;
            }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Calls the resubmit helper class to transmit the message back to BizTalk.  Logs the result to the portal audit log.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> resubmitButton_Click(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
        {
            </span><span style="color: #008000;">//</span><span style="color: #008000;">Resubmit the message to the selected receive location via HTTP</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> messageID </span><span style="color: #000000;">=</span><span style="color: #000000;"> ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageIDLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text;
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> statusCode;
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> statusMessage;

            </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> ResubmitMessage(((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).SelectedValue, </span><span style="color: #0000FF;">out</span><span style="color: #000000;"> statusCode, </span><span style="color: #0000FF;">out</span><span style="color: #000000;"> statusMessage);
            </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitAttempted </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (result </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">)
            {
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;img src='../images/severitycritical.gif' style='vertical-align:middle;'/&gt;&amp;nbsp;The resubmission failed: </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> statusCode </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> - </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> statusMessage;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).ForeColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.Red;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitSuccessful </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
                </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;
                </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditModeAvailable </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;img src='../images/severityinformation.gif' style='vertical-align:middle;'/&gt;&amp;nbsp;This message has been successfully resubmitted.</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).ForeColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.Black;
                ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
            }

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Update the resubmission status in the Message table</span><span style="color: #008000;">
</span><span style="color: #000000;">            UpdateMessageResubmissionStatus(result);

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Write an audit log event for the message resubmission</span><span style="color: #008000;">
</span><span style="color: #000000;">            AuditMessageResubmission(result, statusCode, statusMessage, ((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).SelectedValue);
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Resubmits the message body to the URL selected in the resubmit location DropDownList.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;returns&gt;</span><span style="color: #008000;">True if the message was successfully resubmitted, false otherwise.</span><span style="color: #808080;">&lt;/returns&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> ResubmitMessage(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> resubmitUrl, </span><span style="color: #0000FF;">out</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> responseCode, </span><span style="color: #0000FF;">out</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> responseMessage)
        {
            </span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> result </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">false</span><span style="color: #000000;">;    </span><span style="color: #008000;">//</span><span style="color: #008000;"> returned.</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (resubmitUrl.ToUpper().Equals(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">WCF ONRAMP</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
            {
                </span><span style="color: #008000;">//</span><span style="color: #008000;"> resubmit message and capture the result</span><span style="color: #008000;">
</span><span style="color: #000000;">                System.Xml.XmlDocument doc </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> System.Xml.XmlDocument();
                doc.LoadXml(((TextBox)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text);
                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> MessageResubmitter.ResubmitWCF(doc);
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (result </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">)
                {
                    responseCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">202</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                    responseMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Successfully sumbitted to WCF OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                }
                </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
                {
                    responseCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">500</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                    responseMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Failure submitting to WCF OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                }
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;"> </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (resubmitUrl.ToUpper().Equals(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SOAP ONRAMP</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
            {
                </span><span style="color: #008000;">//</span><span style="color: #008000;"> resubmit message and capture the result</span><span style="color: #008000;">
</span><span style="color: #000000;">                System.Xml.XmlDocument doc </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> System.Xml.XmlDocument();
                doc.LoadXml(((TextBox)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text);
                result </span><span style="color: #000000;">=</span><span style="color: #000000;"> MessageResubmitter.ResubmitSOAP(doc);
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (result </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">)
                {
                    responseCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">202</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                    responseMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Successfully sumbitted to SOAP OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                }
                </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
                {
                    responseCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">500</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                    responseMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Failure submitting to SOAP OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                }
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                HttpStatusCode statusCode;

</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> MessageToSubmit </span><span style="color: #000000;">=</span><span style="color: #000000;"> getCompleteContent(((TextBox)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">
)).Text);
                </span><span style="color: #008000;">//</span><span style="color: #008000;">check to see if we need to set a proxy</span><span style="color: #008000;">
</span><span style="color: #000000;">                </span><span style="color: #0000FF;">using</span><span style="color: #000000;"> (Stream messageReader </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.GetMessageDataStream(MessageToSubmit))
                {
                    HttpWebRequest HttpWRequest </span><span style="color: #000000;">=</span><span style="color: #000000;"> (HttpWebRequest)WebRequest.Create(resubmitUrl);

                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> TODO: (jsk) put settings in web.config
                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> set the name of the user agent. This is the client name that is passed to IIS</span><span style="color: #008000;">
</span><span style="color: #000000;">                    HttpWRequest.Headers.Set(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Pragma</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">no-cache</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

                    HttpWRequest.UserAgent </span><span style="color: #000000;">=</span><span style="color: #000000;"> Page.User.Identity.Name;
                    HttpWRequest.KeepAlive </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">; </span><span style="color: #008000;">//</span><span style="color: #008000;">this is the default</span><span style="color: #008000;">
</span><span style="color: #000000;">                    HttpWRequest.Timeout </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">300000</span><span style="color: #000000;">;
                    HttpWRequest.Method </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">POST</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                    HttpWRequest.ContentType </span><span style="color: #000000;">=</span><span style="color: #000000;"> MessageContentType;
                    HttpWRequest.Credentials </span><span style="color: #000000;">=</span><span style="color: #000000;"> CredentialCache.DefaultCredentials;

                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> resubmit message and capture the result</span><span style="color: #008000;">
</span><span style="color: #000000;">
                    statusCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> MessageResubmitter.ResubmitHTTP(HttpWRequest, messageReader);

                    </span><span style="color: #008000;">//</span><span style="color: #008000;">Anything between 200 and 299 is considered success</span><span style="color: #008000;">
</span><span style="color: #000000;">                    result </span><span style="color: #000000;">=</span><span style="color: #000000;"> ((</span><span style="color: #0000FF;">int</span><span style="color: #000000;">)statusCode </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">199</span><span style="color: #000000;"> </span><span style="color: #000000;">&amp;&amp;</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">int</span><span style="color: #000000;">)statusCode </span><span style="color: #000000;">&lt;</span><span style="color: #000000;"> </span><span style="color: #800080;">301</span><span style="color: #000000;">);
                    responseCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> ((</span><span style="color: #0000FF;">int</span><span style="color: #000000;">)statusCode).ToString();
                    responseMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> Enum.GetName(</span><span style="color: #0000FF;">typeof</span><span style="color: #000000;">(HttpStatusCode), statusCode);
                }
            }
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> result;
        }

</span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> getCompleteContent(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> body)
        {
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> UberDocument </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;ns1:Message xmlns:ns1=\&quot;http://Message\&quot;&gt;</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            UberDocument </span><span style="color: #000000;">+=</span><span style="color: #000000;"> SerializeContext();
            UberDocument </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;ns1:Body&gt;</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> body </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">&lt;/ns1:Body&gt;&lt;/ns1:Message&gt;</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;">
 UberDocument;
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Extracts and returns a Stream from the given string.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;messageDataString&quot;&gt;</span><span style="color: #008000;">The string to extract into a stream.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;returns&gt;</span><span style="color: #008000;">A stream from the given string.</span><span style="color: #808080;">&lt;/returns&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> Stream GetMessageDataStream(</span><span style="color: #0000FF;">string</span><span style="color: #000000;"> messageDataString)
        {
            MemoryStream ms </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> MemoryStream(ASCIIEncoding.Default.GetBytes(messageDataString));
            </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> ms;
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Updates the ResubmitAttempted and ResubmitSuccessful fields on the Message table
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> in the database.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;success&quot;&gt;</span><span style="color: #008000;">True if the message was successfully resubmitted, false otherwise.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> UpdateMessageResubmissionStatus(</span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> success)
        {
            IExceptionService client </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
            </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
            {
                client </span><span style="color: #000000;">=</span><span style="color: #000000;"> PortalHelper.GetExceptionService();
                client.InsertMessage(((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageIDLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text, </span><span style="color: #0000FF;">true</span><span style="color: #000000;">, success);
            }

</span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
            {
                </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> ex;
            }
            </span><span style="color: #0000FF;">finally</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (client </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                {
                    ((IDisposable)client).Dispose(
);
                }
            }

            </span><span style="color: #008000;">//</span><span style="color: #008000;">DataSets.Faults.MessagesDataTable messageTable = new DataSets.Faults.MessagesDataTable();</span><span style="color: #008000;">
</span><span style="color: #000000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;">/The only values that are used by this call are MessageID, ResubmissionAttempted, and ResubmissionSuccessful.
            </span><span style="color: #808080;">///</span><span style="color: #008000;">/The 2nd new Guid is just there because null is not accepted.</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #008000;">//</span><span style="color: #008000;">messageTable.AddMessagesRow(((Label)this.MessageView.FindControl(&quot;messageIDLabel&quot;)).Text, null, null, null, null, null, null, null, true, success, DateTime.Now);
            </span><span style="color: #008000;">//</span><span style="color: #008000;">MessagesTableAdapter messageAdapter = new MessagesTableAdapter();
            </span><span style="color: #008000;">//</span><span style="color: #008000;">messageAdapter.Update(messageTable);</span><span style="color: #008000;">
</span><span style="color: #000000;">        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Writes the failed or successful resubmission event to the audit log.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;success&quot;&gt;</span><span style="color: #008000;">True if the message was successfully resubmitted, false otherwise.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> AuditMessageResubmission(</span><span style="color: #0000FF;">bool</span><span style="color: #000000;"> success, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> resubmitCode, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> resubmitMessage, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> resubmitUrl)
        {
            IExceptionService client </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
            </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
            {
                client </span><span style="color: #000000;">=</span><span style="color: #000000;"> PortalHelper.GetExceptionService();
                AuditLog auditLog </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> AuditLog();
                auditLog.ActionName </span><span style="color: #000000;">=</span><span style="color: #000000;"> success </span><span style="color: #000000;">?</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SuccessfulResubmit</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> : </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">UnsuccessfulResubmit</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                auditLog.AuditDate </span><span style="color: #000000;">=</span><span style="color: #000000;"> DateTime.UtcNow;
                auditLog.AuditUserName </span><span style="color: #000000;">=</span><span style="color: #000000;"> Page.User.Identity.Name;
                auditLog.MessageID </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> Guid(((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageIDLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text);
                auditLog.ResubmitURL </span><span style="color: #000000;">=</span><span style="color: #000000;"> resubmitUrl;
                auditLog.ResubmitCode </span><span style="color: #000000;">=</span><span style="color: #000000;"> resubmitCode;
                auditLog.ResubmitMessage </span><span style="color: #000000;">=</span><span style="color: #000000;"> resubmitMessage;
                auditLog.MessageData </span><span style="color: #000000;">=</span><span style="color: #000000;"> ((TextBox)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text;

                </span><span style="color: #008000;">//</span><span style="color: #008000;">client.InsertAuditLog(auditLog);</span><span style="color: #008000;">
</span><span style="color: #000000;">
            }
            </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
            {
                </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> ex;
            }
            </span><span style="color: #0000FF;">finally</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (client </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                {
                    ((IDisposable)client).Dispose(
);
                }
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;">/Insert audit information</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #008000;">//</span><span style="color: #008000;">AuditLogTableAdapter auditLogTA = new AuditLogTableAdapter();

            </span><span style="color: #008000;">//</span><span style="color: #008000;">DataSets.AuditLog.AuditLogDataTable auditLogTable = new DataSets.AuditLog.AuditLogDataTable();

            </span><span style="color: #008000;">//</span><span style="color: #008000;">DataSets.AuditLog.AuditLogRow auditRow = auditLogTable.NewAuditLogRow();

            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.ActionName = success ? &quot;SuccessfulResubmit&quot; : &quot;UnsuccessfulResubmit&quot;;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.AuditDate = DateTime.UtcNow;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.AuditUserName = Page.User.Identity.Name;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.MessageID = new Guid(((Label)this.MessageView.FindControl(&quot;messageIDLabel&quot;)).Text);
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.ResubmitURL = resubmitUrl;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.ResubmitCode = resubmitCode;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditRow.ResubmitMessage = resubmitMessage;</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #808080;">///</span><span style="color: #008000;">/auditRow.ContentType = (((Label)this.MessageView.FindControl(&quot;contentTypeLabel&quot;)).Text);</span><span style="color: #808080;">
</span><span style="color: #000000;">
            </span><span style="color: #008000;">//</span><span style="color: #008000;">if (success)
            </span><span style="color: #008000;">//</span><span style="color: #008000;">{
            </span><span style="color: #008000;">//</span><span style="color: #008000;">    auditRow.MessageData = ((TextBox)this.MessageView.FindControl(&quot;messageBodyBox&quot;)).Text;
            </span><span style="color: #008000;">//</span><span style="color: #008000;">}

            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditLogTable.AddAuditLogRow(auditRow);

            </span><span style="color: #008000;">//</span><span style="color: #008000;">auditLogTA.Update(auditLogTable);</span><span style="color: #008000;">
</span><span style="color: #000000;">        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Populates the receive location selection list with the WCF OnRamp, the SOAP OnRamp, and/or all HTTP receive locations on the BizTalk group.  Flat File resubmission is limited to HTTP receive
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> locations only, while XML document resubmission can be to WCF, SOAP, or HTTP.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> PopulateReceiveLocationList()
        {
            BizTalkOperationsService.Operations queryService </span><span style="color: #000000;">=</span><span style="color: #000000;"> Microsoft.Practices.ESB.Portal.BizTalkOperationsService.Operations.CreateInstance();
            BizTalkOperationsService.BTSysStatus sysStatus </span><span style="color: #000000;">=</span><span style="color: #000000;"> queryService.ReceiveLocations(</span><span style="color: #0000FF;">string</span><span style="color: #000000;">.Empty);

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Loop through the receive locations and extract the HTTP and WCF HTTP receive locations.</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> i </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">;
            ArrayList httpRcvLocs </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ArrayList();
            </span><span style="color: #0000FF;">foreach</span><span style="color: #000000;"> (BizTalkOperationsService.BTReceiveLocation rcvLoc </span><span style="color: #0000FF;">in</span><span style="color: #000000;"> sysStatus.ReceiveLocations)
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (rcvLoc.Handler.ProtocolName.ToUpper().Equals(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">HTTP</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">))
                {
                    rcvLoc.Address </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">http://</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> rcvLoc.Handler.Host.HostInstances[</span><span style="color: #800080;">0</span><span style="color: #000000;">].ServerName </span><span style="color: #000000;">+</span><span style="color: #000000;"> rcvLoc.Address;
                    httpRcvLocs.Add(rcvLoc);
                    i</span><span style="color: #000000;">++</span><span style="color: #000000;">;
                }
            }

            DropDownList receiveLocList </span><span style="color: #000000;">=</span><span style="color: #000000;"> ((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">));

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Add a default selection to the applications list</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (String.IsNullOrEmpty(((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">routingURLLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text))
            {
                receiveLocList.Items.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ListItem(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Select a receive location.</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #0000FF;">null</span><span style="color: #000000;">));
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                receiveLocList.Items.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ListItem(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Submit to Routing URL</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">routingURLLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text));
            }

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Add the WCF and SOAP OnRamps if the message is not a flat file</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">contentTypeLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Text.ToUpper() </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">TEXT/PLAIN</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
            {
                receiveLocList.Items.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ListItem(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">WCF OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">WCF OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)); </span><span style="color: #008000;">//</span><span style="color: #008000;">URL will be retrieved from web.config</span><span style="color: #008000;">
</span><span style="color: #000000;">                receiveLocList.Items.Add(</span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ListItem(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SOAP OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SOAP OnRamp</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)); </span><span style="color: #008000;">//</span><span style="color: #008000;">URL will be retrieved from web.config</span><span style="color: #008000;">
</span><span style="color: #000000;">            }

            </span><span style="color: #008000;">//</span><span style="color: #008000;">Populate the receive locations list with the receive locations from BizTalk </span><span style="color: #008000;">
</span><span style="color: #000000;">            receiveLocList.AppendDataBoundItems </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
            receiveLocList.DataSource </span><span style="color: #000000;">=</span><span style="color: #000000;"> httpRcvLocs;
            receiveLocList.DataTextField </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            receiveLocList.DataValueField </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Address</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            receiveLocList.DataBind();
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> This method shows or hides the correct control to display the message body.  When the message
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> body is text based, it is rendered to the screen in a TextBox.  When the message body is binary
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> a link is displayed to download it.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> RenderMessageBody()
        {
            </span><span style="color: #008000;">//</span><span style="color: #008000;">If the message content type is text</span><span style="color: #008000;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageIsText)
            {
                </span><span style="color: #008000;">//</span><span style="color: #008000;">Make the message body download link invisible.</span><span style="color: #008000;">
</span><span style="color: #000000;">                ((TextBox)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
            }
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Reads the mode from the querystring, and shows/hides the appropriate buttons.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> By default the Edit button is shown, if the mode = Edit, the Resubmit and Cancel buttons
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> are shown.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> SetControlVisibility()
        {
            ((HtmlGenericControl)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">editButton</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditModeAvailable;
            ((HtmlAnchor)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyAnchor</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditModeAvailable;
            ((LinkButton)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmitButton</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode;
            ((HtmlGenericControl)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">cancelButton</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode;
            ((DropDownList)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">receiveLocationList</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode;
            ((Label)</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">resubmissionLabel</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)).Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.ResubmitAttempted;
        }

        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Sets the editability of controls based on whether the page is in edit mode.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> SetControlEditability()
        {
            TextBox messageBodyBox </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">this</span><span style="color: #000000;">.MessageView.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">messageBodyBox</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">) </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> TextBox;

            messageBodyBox.ReadOnly </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">!</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode;

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (</span><span style="color: #000000;">!</span><span style="color: #0000FF;">this</span><span style="color: #000000;">.EditMode)
            {
                messageBodyBox.BackColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.WhiteSmoke;
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                messageBodyBox.BackColor </span><span style="color: #000000;">=</span><span style="color: #000000;"> System.Drawing.Color.White;
            }

        }

        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> GetCrumbedString(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> t, </span><span style="color: #0000FF;">int</span><span style="color: #000000;"> crumbAt)
        {
            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> text </span><span style="color: #000000;">=</span><span style="color: #000000;"> t.ToString();
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (text.Length </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> crumbAt)
            {
                </span><span style="color: #008000;">//</span><span style="color: #008000;">return &quot;&lt;span title='&quot; + text + &quot;'&gt;&quot; + HttpUtility.HtmlEncode(  PortalHelper.CrumbString(text, crumbAt)) + &quot;&lt;/span&gt;&quot;;</span><span style="color: #008000;">
</span><span style="color: #000000;">                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> HttpUtility.HtmlEncode(PortalHelper.CrumbString(text, crumbAt));
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> text;
            }
        }

        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> labelHeaderCaption_PreRender(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, EventArgs e)
        {
            Label me </span><span style="color: #000000;">=</span><span style="color: #000000;"> (Label)sender;

            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (Request.QueryString[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">esb:Mode</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">] </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Edit</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)
            {
                me.CssClass </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">iconMessageEdit</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            }
            </span><span style="color: #0000FF;">else</span><span style="color: #000000;">
            {
                me.CssClass </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">iconMessage</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
            }
        }

        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> contextPropertiesView_RowDataBound(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, GridViewRowEventArgs e)
        {
            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (e.Row.RowType </span><span style="color: #000000;">==</span><span style="color: #000000;"> DataControlRowType.DataRow)
            {
                Label name </span><span style="color: #000000;">=</span><span style="color: #000000;"> e.Row.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">lblName</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">) </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> Label;

                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (name </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;"> </span><span style="color: #000000;">&amp;&amp;</span><span style="color: #000000;"> name.Text.Equals(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">ItineraryHeader</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, StringComparison.InvariantCultureIgnoreCase))
                {
                    Label content </span><span style="color: #000000;">=</span><span style="color: #000000;"> e.Row.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">lblValueOriginal</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">) </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> Label;

                    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (content </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;"> </span><span style="color: #000000;">&amp;&amp;</span><span style="color: #000000;"> </span><span style="color: #000000;">!</span><span style="color: #0000FF;">string</span><span style="color: #000000;">.IsNullOrEmpty(content.Text))
                    {
                        </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> contentData </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpUtility.HtmlDecode(content.Text);
                        XmlDocument xml </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> XmlDocument();
                        xml.LoadXml(contentData);
                        XmlNodeList nodeList </span><span style="color: #000000;">=</span><span style="color: #000000;"> xml.GetElementsByTagName(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Itinerary</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

                        </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (nodeList.Count </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">)
                        {
                            XmlNode node </span><span style="color: #000000;">=</span><span style="color: #000000;"> nodeList[</span><span style="color: #800080;">0</span><span style="color: #000000;">];
                            </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (node.Attributes[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">uuid</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">] </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                            {
                                </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> itineraryUuid </span><span style="color: #000000;">=</span><span style="color: #000000;"> node.Attributes[</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">uuid</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">].Value;
                                HyperLink lnk </span><span style="color: #000000;">=</span><span style="color: #000000;"> e.Row.FindControl(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">hlnkItineraries</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">) </span><span style="color: #0000FF;">as</span><span style="color: #000000;"> HyperLink;
                                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (lnk </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                                {
                                    lnk.Visible </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">true</span><span style="color: #000000;">;
                                    lnk.NavigateUrl </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Itineraries.aspx?uuid=</span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> itineraryUuid;
                                }
                            }
                        }
                    }
                }
            }
        }

        </span><span style="color: #0000FF;">protected</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> contextPropertiesView_PageIndexChanging(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> sender, GridViewPageEventArgs e)
        {
            contextPropertiesView.PageIndex </span><span style="color: #000000;">=</span><span style="color: #000000;"> e.NewPageIndex;
            BindGrid();
        }
    }
}
</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>This creates a message that looks like this: </p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:e41532c3-0f7f-4bf9-b1a4-760fc1e10a1e" class="wlWriterEditableSmartContent">
<pre style=" width: 804px; height: 246px;background-color:White;overflow: visible;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">ns1:Message </span><span style="color: #FF0000;">xmlns:ns1</span><span style="color: #0000FF;">=&quot;http://Message&quot;</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">ns1:Context</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
    </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">ns1:Property </span><span style="color: #FF0000;">Name</span><span style="color: #0000FF;">=&quot;&quot;</span><span style="color: #FF0000;"> Type</span><span style="color: #0000FF;">=&quot;&quot;</span><span style="color: #FF0000;"> Value</span><span style="color: #0000FF;">=&quot;&quot;</span><span style="color: #FF0000;"> </span><span style="color: #0000FF;">/&gt;</span><span style="color: #000000;">
    </span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">All of the context properties associated</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;">
    </span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">Except those from the All.Exceptions</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;">
    </span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">And the InboundTransportLocation (cause it is always the ESB Exception)</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;">
    </span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">Along with any that has the error-report</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">ns1:Context</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
  </span><span style="color: #0000FF;">&lt;</span><span style="color: #800000;">ns1:Body</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
    Content that is displayed in the text box
  </span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">ns1:Body</span><span style="color: #0000FF;">&gt;</span><span style="color: #000000;">
</span><span style="color: #0000FF;">&lt;/</span><span style="color: #800000;">ns1:Message</span><span style="color: #0000FF;">&gt;</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>Well, the problem is that we don’t have a schema that looks like this message. I really just want to submit the content contained in the Body. So I created a decode pipeline component that access the SSO Configuration Store to promote certain properties of the message as it comes back into BizTalk.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:f36582ab-3093-4127-8c3c-51c9da8bc6eb" class="wlWriterEditableSmartContent">
<pre style=" width: 1427px; height: 1215px;background-color:White;overflow: auto;">
<div><!--

Code highlighting produced by Actipro CodeHighlighter (freeware)

http://www.CodeHighlighter.com/

--><span style="color: #0000FF;">using</span><span style="color: #000000;"> System;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.IO;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Xml;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Xml.XPath;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.ComponentModel;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Collections;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Microsoft.BizTalk.Message.Interop;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Microsoft.BizTalk.Component.Interop;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> Microsoft.Win32;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Web;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Text;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> SSO.Utility;
</span><span style="color: #0000FF;">using</span><span style="color: #000000;"> System.Diagnostics;

</span><span style="color: #0000FF;">namespace</span><span style="color: #000000;"> StottCreations.ContextReader
{
    </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> PromoteContext
    {
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> Implements a pipeline component that takes unwraps the data from the body of the xml document
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> and promotes the values in the content of the message to the context of the messaage payload.
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;remarks&gt;</span><span style="color: #008000;">
        </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/remarks&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">        [ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
        [ComponentCategory(CategoryTypes.CATID_Decoder)]
        [System.Runtime.InteropServices.Guid(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">FA7F9C55-6E8E-4855-8DAC-FA1BC8A499E2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">)]
        </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">class</span><span style="color: #000000;"> PromoteContextComponent : Microsoft.BizTalk.Component.Interop.IBaseComponent,
                                          Microsoft.BizTalk.Component.Interop.IComponent,
                                          Microsoft.BizTalk.Component.Interop.IPersistPropertyBag,
                                          Microsoft.BizTalk.Component.Interop.IComponentUI
        {
            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> Pipeline Properties</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> ssoApplication </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Application that contains all of the properties to be passed through the pipeline
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> SSOApplication
            {
                </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> ssoApplication; }
                </span><span style="color: #0000FF;">set</span><span style="color: #000000;"> { ssoApplication </span><span style="color: #000000;">=</span><span style="color: #000000;"> value; }
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">
            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> IBaseComponent</span><span style="color: #000000;">

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Name of the component.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            [Browsable(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">)]
            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Name
            {
                </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Context Promoter</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">; }
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Version of the component.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            [Browsable(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">)]
            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Version
            {
                </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">1.0</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">; }
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Description of the component.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            [Browsable(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">)]
            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Description
            {
                </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Promotes context data from message and passes the data to Dissassembler</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">; }
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> IComponent</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
            {
                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                    inmsg </span><span style="color: #000000;">=</span><span style="color: #000000;"> Promote(inmsg);
                    inmsg.BodyPart.Data </span><span style="color: #000000;">=</span><span style="color: #000000;"> TransformMessage(inmsg.BodyPart.GetOriginalDataStream());
                }
                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
                {
                    EventLog.WriteEntry(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Promote Pipeline Component</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, ex.Message, EventLogEntryType.Error);
                }
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> inmsg;
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> Helper function</span><span style="color: #000000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Extracts data from message
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;stm&quot;&gt;</span><span style="color: #008000;">Stream with input XML message</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;returns&gt;</span><span style="color: #008000;">Message</span><span style="color: #808080;">&lt;/returns&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> Stream TransformMessage(Stream stm)
            {
                Stream s </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;

                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                    </span><span style="color: #008000;">//</span><span style="color: #008000;">Load Xml stream in XmlDocument.</span><span style="color: #008000;">
</span><span style="color: #000000;">                    XmlDocument doc </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> XmlDocument();
                    doc.Load(stm);
                    XPathNavigator nav </span><span style="color: #000000;">=</span><span style="color: #000000;"> doc.CreateNavigator();
                    XPathNodeIterator iter;

                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> retrieve a node-set via XPath</span><span style="color: #008000;">
</span><span style="color: #000000;">                    iter </span><span style="color: #000000;">=</span><span style="color: #000000;"> nav.Select(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">/*[local-name()='Message' and namespace-uri()='http://Message']/*[local-name()='Body' and namespace-uri()='http://Message']</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

                    </span><span style="color: #008000;">//</span><span style="color: #008000;"> make sure a match was found</span><span style="color: #008000;">
</span><span style="color: #000000;">                    </span><span style="color: #0000FF;">while</span><span style="color: #000000;"> (iter.MoveNext())
                    {
                        </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> data </span><span style="color: #000000;">=</span><span style="color: #000000;"> iter.Current.InnerXml;
                        s </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> MemoryStream(ASCIIEncoding.Default.GetBytes(data));

                    }
                }
                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception e)
                {
                    System.Diagnostics.Trace.WriteLine(e.Message);
                    System.Diagnostics.Trace.WriteLine(e.StackTrace);
                    </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> e;
                }
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> s;
            }
            </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> IBaseMessage Promote(IBaseMessage inmsg)
            {
                </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> ErrorMsg </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">string</span><span style="color: #000000;">.Empty;
                XmlDocument doc </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> XmlDocument();
                doc.Load(inmsg.BodyPart.GetOriginalDataStream());
                XPathNavigator nav </span><span style="color: #000000;">=</span><span style="color: #000000;"> doc.CreateNavigator();
                XPathNodeIterator iter;

                </span><span style="color: #008000;">//</span><span style="color: #008000;"> retrieve a node-set via XPath</span><span style="color: #008000;">
</span><span style="color: #000000;">                iter </span><span style="color: #000000;">=</span><span style="color: #000000;"> nav.Select(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">/*[local-name()='Message' and namespace-uri()='http://Message']/*[local-name()='Context' and namespace-uri()='http://Message']/*[local-name()='Property' and namespace-uri()='http://Message']</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

                </span><span style="color: #008000;">//</span><span style="color: #008000;"> make sure a match was found</span><span style="color: #008000;">
</span><span style="color: #000000;">                </span><span style="color: #0000FF;">while</span><span style="color: #000000;"> (iter.MoveNext())
                {
                    </span><span style="color: #008000;">//</span><span style="color: #008000;">Check the SSO Application to see if we should be promoting it, otherwise skip it</span><span style="color: #008000;">
</span><span style="color: #000000;">                    </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (System.Convert.ToBoolean(SSOClientHelper.Read(SSOApplication, HttpUtility.HtmlDecode(iter.Current.GetAttribute(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">)))))
                    {
                        </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                        {
                            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Name </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpUtility.HtmlDecode(iter.Current.GetAttribute(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">));
                            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Type </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpUtility.HtmlDecode(iter.Current.GetAttribute(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Type</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">));
                            </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> Value </span><span style="color: #000000;">=</span><span style="color: #000000;"> HttpUtility.HtmlDecode(iter.Current.GetAttribute(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Value</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">));
                            inmsg.Context.Promote(Name, Type, Value);
                        }
                        </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception)
                        {
                            </span><span style="color: #008000;">//</span><span style="color: #008000;">We could not promote this particular property, let's report it and go on</span><span style="color: #008000;">
</span><span style="color: #000000;">                            ErrorMsg </span><span style="color: #000000;">+=</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">The </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> SSOApplication </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;"> SSO Application was attempting to promote </span><span style="color: #800000;">&quot;</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> HttpUtility.HtmlDecode(iter.Current.GetAttribute(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Name</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, </span><span style="color: #800000;">&quot;&quot;</span><span style="color: #000000;">)) </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">, but it it can't be promoted, please remove it./r/n</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">;
                        }
                    }
                }
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (ErrorMsg.Length </span><span style="color: #000000;">&gt;</span><span style="color: #000000;"> </span><span style="color: #800080;">0</span><span style="color: #000000;">) EventLog.WriteEntry(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">Promote Pipeline Component</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, ErrorMsg.Substring(</span><span style="color: #800080;">0</span><span style="color: #000000;">,</span><span style="color: #800080;">2048</span><span style="color: #000000;">), EventLogEntryType.Warning);
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> inmsg;
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> IPersistPropertyBag</span><span style="color: #000000;">

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Gets class ID of component for usage from unmanaged code.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;classid&quot;&gt;</span><span style="color: #008000;">Class ID of the component.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> GetClassID(</span><span style="color: #0000FF;">out</span><span style="color: #000000;"> Guid classid)
            {
                classid </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> System.Guid(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">DA7F9C55-6E8E-4855-8DAC-FA1BC8A499E2</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Not implemented.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> InitNew()
            {
            }

            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Load(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, Int32 errlog)
            {
                </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> val </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">string</span><span style="color: #000000;">)ReadPropertyBag(pb, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SSOApplication</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (val </span><span style="color: #000000;">!=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">) ssoApplication </span><span style="color: #000000;">=</span><span style="color: #000000;"> val;
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Saves the current component configuration into the property bag.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;pb&quot;&gt;</span><span style="color: #008000;">Configuration property bag.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;fClearDirty&quot;&gt;</span><span style="color: #008000;">Not used.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;fSaveAllProperties&quot;&gt;</span><span style="color: #008000;">Not used.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> Save(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, Boolean fClearDirty, Boolean fSaveAllProperties)
            {
                </span><span style="color: #0000FF;">object</span><span style="color: #000000;"> val </span><span style="color: #000000;">=</span><span style="color: #000000;"> (</span><span style="color: #0000FF;">object</span><span style="color: #000000;">)ssoApplication;
                WritePropertyBag(pb, </span><span style="color: #800000;">&quot;</span><span style="color: #800000;">SSOApplication</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">, val);
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Reads property value from property bag.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;pb&quot;&gt;</span><span style="color: #008000;">Property bag.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;propName&quot;&gt;</span><span style="color: #008000;">Name of property.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;returns&gt;</span><span style="color: #008000;">Value of the property.</span><span style="color: #808080;">&lt;/returns&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">object</span><span style="color: #000000;"> ReadPropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> propName)
            {
                </span><span style="color: #0000FF;">object</span><span style="color: #000000;"> val </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                    pb.Read(propName, </span><span style="color: #0000FF;">out</span><span style="color: #000000;"> val, </span><span style="color: #800080;">0</span><span style="color: #000000;">);
                }

                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (System.ArgumentException)
                {
                    </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> val;
                }
                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
                {
                    </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ApplicationException(ex.Message);
                }
                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> val;
            }

            </span><span style="color: #0000FF;">private</span><span style="color: #000000;"> </span><span style="color: #0000FF;">static</span><span style="color: #000000;"> </span><span style="color: #0000FF;">void</span><span style="color: #000000;"> WritePropertyBag(Microsoft.BizTalk.Component.Interop.IPropertyBag pb, </span><span style="color: #0000FF;">string</span><span style="color: #000000;"> propName, </span><span style="color: #0000FF;">object</span><span style="color: #000000;"> val)
            {
                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                    pb.Write(propName, </span><span style="color: #0000FF;">ref</span><span style="color: #000000;"> val);
                }
                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception ex)
                {
                    </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ApplicationException(ex.Message);
                }
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">

            </span><span style="color: #0000FF;">#region</span><span style="color: #000000;"> IComponentUI</span><span style="color: #000000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> Component icon to use in BizTalk Editor.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            [Browsable(</span><span style="color: #0000FF;">false</span><span style="color: #000000;">)]
            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> IntPtr Icon
            {
                </span><span style="color: #0000FF;">get</span><span style="color: #000000;"> { </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> IntPtr.Zero; }
            }

            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> The Validate method is called by the BizTalk Editor during the build
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> of a BizTalk project.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/summary&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;param name=&quot;obj&quot;&gt;</span><span style="color: #008000;">Project system.</span><span style="color: #808080;">&lt;/param&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;returns&gt;</span><span style="color: #008000;">
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> A list of error and/or warning messages encounter during validation
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> of this component.
            </span><span style="color: #808080;">///</span><span style="color: #008000;"> </span><span style="color: #808080;">&lt;/returns&gt;</span><span style="color: #808080;">
</span><span style="color: #000000;">            </span><span style="color: #0000FF;">public</span><span style="color: #000000;"> IEnumerator Validate(</span><span style="color: #0000FF;">object</span><span style="color: #000000;"> projectSystem)
            {
                </span><span style="color: #0000FF;">if</span><span style="color: #000000;"> (projectSystem </span><span style="color: #000000;">==</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">)
                    </span><span style="color: #0000FF;">throw</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> System.ArgumentNullException(</span><span style="color: #800000;">&quot;</span><span style="color: #800000;">No project system</span><span style="color: #800000;">&quot;</span><span style="color: #000000;">);

                IEnumerator enumerator </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">null</span><span style="color: #000000;">;
                ArrayList strList </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000FF;">new</span><span style="color: #000000;"> ArrayList();

                </span><span style="color: #0000FF;">try</span><span style="color: #000000;">
                {
                }
                </span><span style="color: #0000FF;">catch</span><span style="color: #000000;"> (Exception e)
                {
                    strList.Add(e.Message);
                    enumerator </span><span style="color: #000000;">=</span><span style="color: #000000;"> strList.GetEnumerator();
                }

                </span><span style="color: #0000FF;">return</span><span style="color: #000000;"> enumerator;
            }

            </span><span style="color: #0000FF;">#endregion</span><span style="color: #000000;">
        }
    }
}</span></div>
</pre>
<p><!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --></div>
<p>So in the pipeline that I have used to submit xml data back to the message box looks like this:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb.png" width="659" height="531" /></a></p>
<p>Within the SSO Configuration, I can promote as many (or few) properties as I need. Here is the only things I wanted to promote:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb1.png" width="746" height="199" /></a></p>
<p>This means that it will take all of the properties, and <em>only</em> promote <em>ReceivedFileName</em> and <em>OrderedDelivery</em>. </p>
<p>There are certain properties that are not promotable, and as such, it will not blow up, but simply write an entry into the event log and continue on. You should really remove it from the SSO Configuration Store.</p>
<p>To address the need to carry data between one service call to the next, I had to modify the MessageEnrichment orchestration.</p>
<p>I modified it in these steps:</p>
<ol>
<li>I went through and created proper labels (<strong>NotOneSingleWordThatMakesItReallyHardToRead</strong>) </li>
<li>Then I went through and created message names that made sense to an ordinary human </li>
<li>I added a separate resolver in the middle so that there was a completely different step to determine the destination, instead of setting the map AND the destination in the resolver </li>
<li>I took the copy context from the original message to the response of the service call. (Why in the world would you do that anyway? The response has a different target name space than the original message.) </li>
</ol>
<p>This is what the new orchestration looks like:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb2.png" width="1046" height="2712" /></a></p>
<p>Which means that I have Itineraries that look like this:</p>
<p><a href="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/wp-content/uploads/2012/04/image_thumb3.png" width="997" height="239" /></a></p>
<p>So if I need to call another service, I simply need to add the same Orchestration Extender, define the next three resolvers:</p>
<ol>
<li>Map that creates the request to the service </li>
<li>Defines the endpoint configuration for the service </li>
<li>The map the enhances the canonical message </li>
</ol>
<p>I really means that it REALLY isn’t ESB though, it is a series of orchestrations chained together that call services.</p>
<p>Not cool…</p>
<p>Voilà</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/enhancements-to-the-esb-toolkit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Visual Studio to debug XSL</title>
		<link>http://blog.biztalk-info.com/2012/04/using-visual-studio-to-debug-xsl/</link>
		<comments>http://blog.biztalk-info.com/2012/04/using-visual-studio-to-debug-xsl/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 03:34:34 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/?p=305</guid>
		<description><![CDATA[So I was attempting to debug an XSL stylesheet and every time I attempted to debug it, I would continually get the following error: Visual Studio encountered an error and will restart. I looked high and low, to no avail. The solution(s) are (one or the other) Disable Visual Studio 2010 Power Tools Move the <a href='http://blog.biztalk-info.com/2012/04/using-visual-studio-to-debug-xsl/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>So I was attempting to debug an XSL stylesheet and every time I attempted to debug it, I would continually get the following error:</p>
<p>Visual Studio encountered an error and will restart.</p>
<p>I looked high and low, to no avail.</p>
<p>The solution(s) are (one or the other)</p>
<ul>
<li>Disable Visual Studio 2010 Power Tools</li>
<li>Move the xsl into a c# project instead of a BizTalk project</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2012/04/using-visual-studio-to-debug-xsl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find schemas deployed in BTS 2004</title>
		<link>http://blog.biztalk-info.com/2011/06/find_schemas_deployed_in_bts_2004/</link>
		<comments>http://blog.biztalk-info.com/2011/06/find_schemas_deployed_in_bts_2004/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 18:30:13 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/archive/2011/06/03/Find_schemas_deployed_in_BTS_2004.aspx</guid>
		<description><![CDATA[If you need to find the schemas that are deployed and their unique root node names you can run this query. Yes BTS 2004 still exists. use biztalkmgmtdb select msgtype as [Schema NameSpace#RootNode], clr_namespace as [Assembly Name], clr_typename as [Schema TypeName], docspec_name as [Schema Namespace.TypeName] from bt_DocumentSpec order by msgtype]]></description>
			<content:encoded><![CDATA[<p>If you need to find the schemas that are deployed and their unique root node names you can run this query.</p>
<p>Yes BTS 2004 still exists.</p>
<p>use biztalkmgmtdb    <br />select msgtype as [Schema NameSpace#RootNode],     <br />clr_namespace as [Assembly Name],     <br />clr_typename as [Schema TypeName],     <br />docspec_name as [Schema Namespace.TypeName]    <br />from bt_DocumentSpec     <br />order by msgtype </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2011/06/find_schemas_deployed_in_bts_2004/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft SQL Server 2008 Data Transformation Services (DTS) for BAM Archiving is not installed on the local machine.</title>
		<link>http://blog.biztalk-info.com/2011/05/bam_tools_configuration_for_biztalk_2010_with_remote_sql_server/</link>
		<comments>http://blog.biztalk-info.com/2011/05/bam_tools_configuration_for_biztalk_2010_with_remote_sql_server/#comments</comments>
		<pubDate>Sat, 28 May 2011 21:47:47 +0000</pubDate>
		<dc:creator>Clown Killer</dc:creator>
				<category><![CDATA[12]]></category>

		<guid isPermaLink="false">http://blog.biztalk-info.com/archive/2011/05/28/BAM_Tools_configuration_for_BizTalk_2010_with_remote_SQL_server.aspx</guid>
		<description><![CDATA[If you get the following error when configuring BAM tools for BizTalk 2010: Microsoft SQL Server 2008 Data Transformation Services (DTS) for BAM Archiving is not installed on the local machine.  Please install Microsoft SQL Server 2008 Integration Services. (Microsoft.BizTalk.Bam.CfgExtHelper.ToolsHelper) For help, click: http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&#38;ProdVer=3.8.368.0&#38;EvtSrc=Microsoft.BizTalk.Bam.CfgExtHelper.ToolsHelper&#38;EvtID=error_DTS2008Archive —————————— ADDITIONAL INFORMATION: Could not load file or assembly ‘Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, <a href='http://blog.biztalk-info.com/2011/05/bam_tools_configuration_for_biztalk_2010_with_remote_sql_server/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>If you get the following error when configuring BAM tools for BizTalk 2010:</p>
<p>Microsoft SQL Server 2008 Data Transformation Services (DTS) for BAM Archiving is not installed on the local machine.  Please install Microsoft SQL Server 2008 Integration Services. (Microsoft.BizTalk.Bam.CfgExtHelper.ToolsHelper)   <br />For help, click: <a href="http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&amp;ProdVer=3.8.368.0&amp;EvtSrc=Microsoft.BizTalk.Bam.CfgExtHelper.ToolsHelper&amp;EvtID=error_DTS2008Archive">http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&amp;ProdVer=3.8.368.0&amp;EvtSrc=Microsoft.BizTalk.Bam.CfgExtHelper.ToolsHelper&amp;EvtID=error_DTS2008Archive</a>    <br />——————————    <br />ADDITIONAL INFORMATION:    <br />Could not load file or assembly ‘Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91′ or one of its dependencies. The system cannot find the file specified. (Microsoft.BizTalk.Bam.CfgExtHelper)</p>
<p>It has to do with installing BizTalk 2010 with a remote SQL 2008 server.  Here’s the fix.</p>
<p>Install the Management Tools (Basic &amp; Complete) SQL 2008 features as shown in the screenshot onto the BizTalk 2010 server:</p>
<p><a href="http://blog.biztalk-info.com/images/BAM-Tools-on_EBB3/image.png" rel="lightbox"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blog.biztalk-info.com/images/BAM-Tools-on_EBB3/image_thumb.png" width="550" height="456" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.biztalk-info.com/2011/05/bam_tools_configuration_for_biztalk_2010_with_remote_sql_server/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

