<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Victor Fehlberg's Tech Postings</title>
	<atom:link href="http://fehlberg.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fehlberg.wordpress.com</link>
	<description>Lessons learned in BizTalk Server, C# and Java</description>
	<lastBuildDate>Wed, 11 Nov 2009 21:06:46 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='fehlberg.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/a3ce8ec1da55c11f66a9228e8d33a1ef?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Victor Fehlberg's Tech Postings</title>
		<link>http://fehlberg.wordpress.com</link>
	</image>
			<item>
		<title>BizTalk Map Bug Causes Inconsistent Results</title>
		<link>http://fehlberg.wordpress.com/2009/11/11/biztalk-map-bug-causes-inconsistent-results/</link>
		<comments>http://fehlberg.wordpress.com/2009/11/11/biztalk-map-bug-causes-inconsistent-results/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:06:46 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=85</guid>
		<description><![CDATA[I found what I would call a bug with the BizTalk Mapper (does anyone dare call it a feature?).  Let me show a simple version of the problem I encountered:
I created a BizTalk project that contains a map that calls an external assembly (in my case part of the same solution), such as:


My external assembly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=85&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I found what I would call a bug with the BizTalk Mapper (does anyone dare call it a feature?).  Let me show a simple version of the problem I encountered:</p>
<p>I created a BizTalk project that contains a map that calls an external assembly (in my case part of the same solution), such as:</p>
<p><img class="alignnone size-full wp-image-87" title="BizTalk Solution contains a Reference" src="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_solution.png?w=308&#038;h=322" alt="BizTalk Solution contains a Reference" width="308" height="322" /></p>
<p><img src="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_map.png" alt="" /></p>
<p>My external assembly is version 1.0.0.0, compiled in Development mode, and it looks like this:</p>
<p>public class Helper<br />
{</p>
<p style="padding-left:30px;">public string ReturnVersion(string ignore)<br />
{<br />
return &#8220;1.0.0.0&#8243;;<br />
}</p>
<p>}</p>
<p>I deployed the map and the assembly.  I tested the map.  Sure enough, &#8220;1.0.0.0&#8243; is mapped to &#8220;SomethingElse&#8221;.  No surprises yet.</p>
<p>I then changed the ReturnVersion function to return &#8220;1.0.0.1&#8243;.  Similarly, I incremented the version of the external assembly and BizTalk project and compiled in Release mode (let&#8217;s pretend I&#8217;m done with development and I&#8217;m now ready to release).  I double checked the references in the Solution Explorer &#8211; sure enough Blog.ShowMapBug.Utilities shows the new version as the reference.</p>
<p><img class="alignnone size-full wp-image-88" title="Properties Window" src="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_properties_window.png" alt="Properties Window" width="359" height="266" /></p>
<p>I deployed the solution and GAC&#8217;d the assembly.  I updated my send port to use the new map.  I restarted the Host Instance.  I then tested things out.  What would you expect to get mapped to SomethingElse?  1.0.0.1, right?  Well it doesn&#8217;t work.  1.0.0.0 still shows up.  Why?</p>
<p>If I open the BizTalk map in an XML editor and search for the assembly, I find:</p>
<p>&lt;Script Language=&#8221;ExternalAssembly&#8221; Assembly=&#8221;Blog.ShowMapBug.Utilities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e767c75a9f3ac928&#8243; Function=&#8221;ReturnVersion&#8221; AssemblyPath=&#8221;..\Blog.ShowMapBug.Utilities\obj\Debug\Blog.ShowMapBug.Utilities.dll&#8221; /&gt;</p>
<p>So, you&#8217;re now thinking what I thought.  Okay, just update the Version number there, right?  Nope.  It turns out that the version number here gets ignored altogether and &#8220;1.0.0.0&#8243; will continue to get mapped to &#8220;SomethingElse&#8221; (using the old assembly).</p>
<p>So what&#8217;s going on?  It turns out that the problem is the AssemblyPath reference.  It&#8217;s pointing at the &#8220;Debug&#8221; version of the external assembly.  Once deployed, you&#8217;d THINK this wouldn&#8217;t be a problem, but it is.  The only way to fix this problem is to point the DLL at the Release mode version of the file, i.e. AssemblyPath=&#8221;..\Blog.ShowMapBug.Utilities\obj\<strong>Release</strong>\Blog.ShowMapBug.Utilities.dll.</p>
<p>Amazing, isn&#8217;t it?  Of course in this simple scenario it wasn&#8217;t too hard to follow.  But of course real maps, real external assemblies and real projects are much more complex, and it took me a few hours to figure out why in the world the project wasn&#8217;t behaving as it was expected to.</p>
<p>&nbsp;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/85/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/85/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/85/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=85&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2009/11/11/biztalk-map-bug-causes-inconsistent-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_solution.png" medium="image">
			<media:title type="html">BizTalk Solution contains a Reference</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_map.png" medium="image" />

		<media:content url="http://fehlberg.files.wordpress.com/2009/11/2009_11_11_properties_window.png" medium="image">
			<media:title type="html">Properties Window</media:title>
		</media:content>
	</item>
		<item>
		<title>Switch from WCF-BasicHttp to WCF-WSHttp in BizTalk?</title>
		<link>http://fehlberg.wordpress.com/2009/10/30/switch-from-wcf-basichttp-to-wcf-wshttp-in-biztalk/</link>
		<comments>http://fehlberg.wordpress.com/2009/10/30/switch-from-wcf-basichttp-to-wcf-wshttp-in-biztalk/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 17:11:04 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=75</guid>
		<description><![CDATA[I learned a new trick that I know someone out there will appreciate&#8230;
First, here&#8217;s a little background. Some time ago, when I hosted my first BizTalk service with WCF, I ran the BizTalk WCF Service Publishing Wizard and was prompted for an adapter name.  I chose WCF-BasicHttp, assuming that I could easily change this later [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=75&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I learned a new trick that I know someone out there will appreciate&#8230;</p>
<p>First, here&#8217;s a little background. Some time ago, when I hosted my first BizTalk service with WCF, I ran the BizTalk WCF Service Publishing Wizard and was prompted for an adapter name.  I chose WCF-BasicHttp, assuming that I could easily change this later (as most of you out there, it&#8217;s nice to start with no security, get things working, and then progress to enable more complicated security schemes).<br />
<img class="alignnone size-full wp-image-76" title="BizTalk WCF Publishing Wizard" src="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_publishing_wizard.png?w=480&#038;h=367" alt="BizTalk WCF Publishing Wizard" width="480" height="367" /></p>
<p>And for those that I haven&#8217;t done this before: After finishing the wizard, the next steps involve verifying/fixed the IIS app pool settings and enabling the receive location.  After that, you should be able to browse the service.  Something like this should appear:</p>
<p><img class="alignnone size-full wp-image-77" title="Browse WCF Service" src="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_svc_browse.png?w=480&#038;h=360" alt="Browse WCF Service" width="480" height="360" /></p>
<p>If you click on the link to browse the WSDL, you&#8217;d find that there is no advanced policy configuration.</p>
<p>Great, we&#8217;ve got our basic http service up.  At some point, you might want something a little more secure, and this was my initial frustration.  I opened up the BizTalk Admin Console, found the receive location hosting the service, and switched from WCF-BasicHttp to WCF-WSHttp.  As part of this, in my case, I added the URI, specified a Security mode of Transport, and a Transport client credential type of Basic.</p>
<p><img class="alignnone size-full wp-image-78" title="WCF-WSHttp Receive Location" src="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_rcv_location.png?w=480&#038;h=383" alt="WCF-WSHttp Receive Location" width="480" height="383" /></p>
<p>I accepted the changes, made sure the receive location was enabled, and tried browsing my service again.</p>
<p><img class="alignnone size-full wp-image-79" title="Error Browsing the WSHttp Service" src="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_svc_error.png?w=480&#038;h=360" alt="Error Browsing the WSHttp Service" width="480" height="360" /></p>
<p>But, as you can see, it didn&#8217;t work.  At the time, not knowing how to fix this, I re-ran the wizard, chose WSHttp, etc.  That made the WSHttp service browsable, but I was frustrated that I had to re-run the wizard, and I happened to have chosen a slightly different naming for the operation, which caused additional headache and rework, etc.</p>
<p>That&#8217;s why I&#8217;m writing this post.  <strong>There&#8217;s a better way</strong>.  Let&#8217;s go back in time&#8230; instead of re-running the wizard and choosing the WSHttp adapter (or Custom-Isolated), I could have simply changed the .svc file, i.e. C:\Inetpub\wwwroot\HelloWorldService\HelloWorld.svc.  The file originally had this inside it:</p>
<p>&lt;%@ ServiceHost Language=&#8221;c#&#8221; Factory=&#8221;Microsoft.BizTalk.Adapter.Wcf.Runtime.<strong>BasicHttp</strong>WebServiceHostFactory, Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243; %&gt;</p>
<p>I changed the HelloWorld.svc ever so slightly to read:</p>
<p>&lt;%@ ServiceHost Language=&#8221;c#&#8221; Factory=&#8221;Microsoft.BizTalk.Adapter.Wcf.Runtime.<strong>WSHttp</strong>WebServiceHostFactory, Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&#8243; %&gt;</p>
<p>I saved the file, and&#8230; (drum roll please)</p>
<p><img class="alignnone size-full wp-image-81" title="WSHttp WSDL" src="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_wshttp_wsdl1.png?w=480&#038;h=360" alt="WSHttp WSDL" width="480" height="360" /></p>
<p>It works!  Here I&#8217;m showing the WSHttp WSDL.  You&#8217;ll notice that you see the corresponding policy information in the file.</p>
<p>So, in conclusion,<strong> yes you can start with one WCF adapter type and switch it later</strong> by 1) updating the receive location in the Admin Console, and 2) updating the .svc file.  For reference here are factory values for the .svc file that the wizard allows you to pick from:</p>
<p>BasicHttp: Microsoft.BizTalk.Adapter.Wcf.Runtime.BasicHttpWebServiceHostFactory</p>
<p>WSHttp: Microsoft.BizTalk.Adapter.Wcf.Runtime.WSHttpWebServiceHostFactory</p>
<p>Custom-Isolated: Microsoft.BizTalk.Adapter.Wcf.Runtime.CustomWebServiceHostFactory</p>
<p>Good luck!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=75&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2009/10/30/switch-from-wcf-basichttp-to-wcf-wshttp-in-biztalk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_publishing_wizard.png" medium="image">
			<media:title type="html">BizTalk WCF Publishing Wizard</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_svc_browse.png" medium="image">
			<media:title type="html">Browse WCF Service</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_rcv_location.png" medium="image">
			<media:title type="html">WCF-WSHttp Receive Location</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_svc_error.png" medium="image">
			<media:title type="html">Error Browsing the WSHttp Service</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2009/10/2009_10_30_wshttp_wsdl1.png" medium="image">
			<media:title type="html">WSHttp WSDL</media:title>
		</media:content>
	</item>
		<item>
		<title>BizTalk R2 Authorization using WCF</title>
		<link>http://fehlberg.wordpress.com/2009/10/06/biztalk-r2-authorization-using-wcf/</link>
		<comments>http://fehlberg.wordpress.com/2009/10/06/biztalk-r2-authorization-using-wcf/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 21:29:24 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=64</guid>
		<description><![CDATA[As some of you may have noticed, I gave a rather scathing review of how WCF implements authorization (and hence how R2 implements authorization for WCF services).  To see that post, click here.  Although I&#8217;m still very disappointed, I&#8217;d like to share an approach that accomplishes the goal I had in mind: being able to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=64&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As some of you may have noticed, I gave a rather scathing review of how WCF implements authorization (and hence how R2 implements authorization for WCF services).  To see that post, <a title="BizTalk R2 WCF Authorization" href="http://fehlberg.wordpress.com/2009/06/18/biztalk-r2-wcf-authorization/">click here</a>.  Although I&#8217;m still very disappointed, I&#8217;d like to share an approach that accomplishes the goal I had in mind: being able to dynamically specify, via means of configuration, the users that should have access rights to the service.  This approach was built by Vijay Naidu, a colleague of mine.</p>
<p>Vijay read my first blog, and took the time to &#8220;code&#8221; authorization into his web service.  With a little tuning, the solution you&#8217;re about to see resulted, which I think is much better than the out-of-the-box solution.  This solution leverages the SSO database to store the authorized users (the code example you&#8217;ll see in this post is written to authorize a single user, but hopefully you wouldn&#8217;t have trouble using a delimited list of users).  In addition, Vijay&#8217;s solution creates a shared component that can be leveraged by multiple projects without recoding the initial setup.  When mixed with <a href="http://seroter.wordpress.com/2007/09/21/biztalk-sso-configuration-data-storage-tool/">Richard Seroter&#8217;s SSO storage tool</a> (I use the <a href="http://geekswithblogs.net/paulp/archive/2008/05/16/122205.aspx">variant by Paul Petrov</a>), you&#8217;ll find that you can set up authorization dynamically.  Hence, I figured you might be interested.  Here were the steps involved:</p>
<p>First, the machine.config file was modified adding this entry:</p>
<table border="0" width="500px" bgcolor="#eeeeee">
<tbody>
<tr>
<td>&lt;system.serviceModel&gt;<br />
&lt;extensions&gt;<br />
&lt;behaviorExtensions&gt;<br />
&lt;add name=&#8221;AcmeWCFCustomAuth&#8221; type=&#8221;Acme.WcfServiceBehaviors.CustomBehaviorElement, Acme.WcfServiceBehaviors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=02ae73d8d306f338&#8243; /&gt;<br />
&lt;/behaviorExtensions&gt;<br />
&lt;/extensions&gt;<br />
&lt;/system.serviceModel&gt;</td>
</tr>
</tbody>
</table>
<p>Secondly, this code was written and added to an assembly (the one mentioned above in the machine.config file).</p>
<table border="0" width="500" bgcolor="#eeeeee">
<tbody>
<tr>
<td>if (context.PrimaryIdentity.IsAuthenticated)<br />
{<br />
userName = context.PrimaryIdentity.Name;<br />
//Get the application name for parsing the Endpoint Uri Absolutepath (ex: /Acme.GlobalSafety.EnsureSafety/ImportantAuth.svc)<br />
ApplicationName = operationContext.EndpointDispatcher.EndpointAddress.Uri.AbsolutePath.ToString();<br />
WcfUriAbsolutePath = ApplicationName.Split(&#8216;/&#8217;);<br />
ApplicationName = WcfUriAbsolutePath[1].ToString();(ex: Acme.GlobalSafety.EnsureSafety)<br />
//Get the SSO Config entry for the user to authenticate (ex: domain\LoginUser).  This call refers to the SSO tool mentioned earlier<br />
wcfAuthUserName = Acme.SSO.Utility.SSOConfigHelper.Read(ApplicationName, &#8220;WCFClientAuthUserName&#8221;);<br />
if (string.Compare(userName.ToUpper(), wcfAuthUserName.ToUpper()) != 0)<br />
return false; //this returns an access denied error<br />
}</td>
</tr>
</tbody>
</table>
<p>This assembly was then compiled, installed in the GAC, and the BizTalk host was restarted.  Next, using the BizTalk Administrator, a Request/Response WCF-Custom receive location was created.  Under the Service Behavior tab the AcmeWCFCustomAuth binding was added.</p>
<p>Next, the WCFClientAuthUserName property was added to the SSO Config database (using the tool mentioned earlier).</p>
<p>That&#8217;s it.  It may have seem like a bunch of work (and I admit that I don&#8217;t want developers redoing this entire thing), which is the beauty of this solution.  Subsequent applications that want to leverage this solution only need to repeat the steps in the last two paragraphs, which isn&#8217;t bad.  The other advantage of this approach, as opposed to putting the username in some configuration file out on disk, is that the SSO databases are part of the BizTalk daily backup job.  In the event of a disaster, they will be recovered, along with all of your beautiful authorization configurations.  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/64/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/64/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/64/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=64&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2009/10/06/biztalk-r2-authorization-using-wcf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>
	</item>
		<item>
		<title>BizTalk R2 WCF Authorization</title>
		<link>http://fehlberg.wordpress.com/2009/06/18/biztalk-r2-wcf-authorization/</link>
		<comments>http://fehlberg.wordpress.com/2009/06/18/biztalk-r2-wcf-authorization/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 23:53:19 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=60</guid>
		<description><![CDATA[Let me share a quick story.  We&#8217;ve been using BizTalk Server 2006 for a couple of years now at my company.  We recently upgraded to R2, and I was excited to get the opportunity to work with WCF&#8230; so a few months ago I created my first WCF service.  Things worked about like what I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=60&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Let me share a quick story.  We&#8217;ve been using BizTalk Server 2006 for a couple of years now at my company.  We recently upgraded to R2, and I was excited to get the opportunity to work with WCF&#8230; so a few months ago I created my first WCF service.  Things worked about like what I expected except for one thing: authorization.  I kept thinking, &#8220;this has got to be really easy&#8221; yet I could never figure out how to restrict access to certain users (this was fairly easy to do with ASMX services).  That&#8217;s what&#8217;s leading me to write this post.</p>
<p>There are a few things I like a lot more about WCF, but there&#8217;s one thing I can&#8217;t stand: the way authorization is implemented.  Here&#8217;s why:</p>
<p>From what I&#8217;ve seen and heard, WCF is intended to make security easier by allowing this to be configured in XML configuration files.  This is neat because the developer can do his/her work easily, and the details on security can be configured dynamically (without recompiling).   It&#8217;s indeed pretty cool that you can change from using Windows Authentication to basic auth, etc. all in a configuration file.  However, this &#8220;guiding principle&#8221; behind WCF doesn&#8217;t hold true when it comes to authorization!  I couldn&#8217;t believe my eyes when I read this post:</p>
<p><a href="http://social.msdn.microsoft.com/Forums/en-US/biztalkr2adapters/thread/12a47533-acb4-4ff4-bc32-d8ea305cb066">http://social.msdn.microsoft.com/Forums/en-US/biztalkr2adapters/thread/12a47533-acb4-4ff4-bc32-d8ea305cb066</a></p>
<p>Are you serious?  I have to write a WHOLE BUNCH of code just to restrict access to a web service?!  There&#8217;s not a wizard for this?  Or perhaps some GUI control?  No XML file for this?  Or how about clicking on &#8220;Permissions&#8221; in IIS like you used to be able to do with ASMX services?  So much for configuring security in an XML file.  I&#8217;m deeply disappointed.</p>
<p>In fact, I really hope I&#8217;m wrong.  Perhaps there&#8217;s some easier way that I just happened to have missed.  Please do tell me this is the case and end this bad dream.</p>
<p>Since I refuse to manage web service access via code for what might end up to become hundreds (or even thousands) of web services, I&#8217;ll have to do this some other way.  I think I&#8217;ll use SOA&#8217;s Service Manager to control authorization (I should get paid for promoting them).  There it can be done easily at the operation level of a web service.  I just thought WCF would have done something like this too.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/60/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/60/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/60/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=60&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2009/06/18/biztalk-r2-wcf-authorization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>
	</item>
		<item>
		<title>BizTalk Server 2006 R2 Support for SQL Server 2005 SP3</title>
		<link>http://fehlberg.wordpress.com/2009/04/15/biztalk-server-2006-r2-support-for-sql-server-2005-sp3/</link>
		<comments>http://fehlberg.wordpress.com/2009/04/15/biztalk-server-2006-r2-support-for-sql-server-2005-sp3/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 15:37:21 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=56</guid>
		<description><![CDATA[With the release of SQL Server 2005 SP3, many of us are wondering if BizTalk Server 2006 is supported with SP3.  I asked Microsoft this question and here was the reply:
&#8220;The BizTalk test team has planned complete testing of this.  However, the Rangers team has tested this setup in a in-house test setup and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=56&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>With the release of SQL Server 2005 SP3, many of us are wondering if BizTalk Server 2006 is supported with SP3.  I asked Microsoft this question and here was the reply:</p>
<p style="padding-left:30px;">&#8220;The BizTalk test team has planned complete testing of this.  However, the Rangers team has tested this setup in a in-house test setup and didn’t encounter any issues. SQL SP3 is fully backwards compatible with SQL 2005 SP2 and hence BizTalk databases are covered (in an indirect way).  We will have a fully supportability statement on this once the official tests are complete.</p>
<p style="padding-left:30px;">&#8220;We are recommending that our customers upgrade to SQL 2005 SP3 since it resolves many of the bugs with SP2 and many have upgraded their environments to SP3 successfully. We are fully committed to encourage our customers to be using the latest service pack/security patches.&#8221;</p>
<p>We proceeded to use SP3 for a new environment we are setting up; we haven&#8217;t encountered any issues yet but we aren&#8217;t using it in production yet (we will be in another couple of weeks).</p>
<p>I figured I&#8217;d share this since I&#8217;m sure it will help someone else out there.  Good luck!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=56&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2009/04/15/biztalk-server-2006-r2-support-for-sql-server-2005-sp3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>
	</item>
		<item>
		<title>Authentication and Authorization of Incoming SOAP Requests to BizTalk</title>
		<link>http://fehlberg.wordpress.com/2008/09/22/authentication-and-authorization-of-incoming-soap-requests-to-biztalk/</link>
		<comments>http://fehlberg.wordpress.com/2008/09/22/authentication-and-authorization-of-incoming-soap-requests-to-biztalk/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 23:21:24 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=48</guid>
		<description><![CDATA[I&#8217;ve been meaning to write a blog on this subject for quite some time&#8230;  this blog will explain authentication and authorization of incoming SOAP messages to BizTalk.  Although it might seem like a simple subject to some, I&#8217;ve seen enough web apps deployed w/o authorization that I figure it&#8217;s worth writing about&#8230;
Here&#8217;s the short answer [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=48&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been meaning to write a blog on this subject for quite some time&#8230;  this blog will explain authentication and authorization of incoming SOAP messages to BizTalk.  Although it might seem like a simple subject to some, I&#8217;ve seen enough web apps deployed w/o authorization that I figure it&#8217;s worth writing about&#8230;</p>
<p>Here&#8217;s the short answer to how BizTalk authenticates and authorizes incoming SOAP messages: <strong>IIS</strong>. When I was first exposed to BizTalk I was disappointed to find that the BizTalk books I owned didn&#8217;t have a section in their index on authorization (perhaps this is the reason so many apps don&#8217;t use it).  I needed to be explicit as to who could access a particular web service.  I didn&#8217;t find anything in the BizTalk Admin Console under any of the receive locations/ports, and as a newbie to IIS, I wasn&#8217;t sure what exactly was available there.  I saw in IIS an easy way to provide authentication, but authorization wasn&#8217;t as clear to me.  So hopefully this will help the next IIS-newbie.</p>
<p>Let&#8217;s first talk about authentication.  Here is the authentication methods screen of the IIS Manager found by right-clicking on the deployed web app and choosing Properties:</p>
<div id="attachment_49" class="wp-caption alignnone" style="width: 381px"><a href="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authentication.png"><img class="size-full wp-image-49" title="2008_09_22_authentication" src="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authentication.png?w=371&#038;h=444" alt="IIS Authentication" width="371" height="444" /></a><p class="wp-caption-text">IIS Authentication</p></div>
<p>As you can see, you have the option to allow anonymous access, Integrated WIndows Authentication (will only work SOAP callers using Windows), Digest authentication (also only for Windows), Basic authentication (very common when working w/non-Windows systems; simple &#8211; only use w/HTTPS since the username/password is sent in the clear), and .NET Passport authentication (also for Windows).  I won&#8217;t explain each of these here because I&#8217;m sure it&#8217;s explained well on MSDN.</p>
<p>Now, for that part that I couldn&#8217;t find in the indices of BizTalk books&#8230; authorization.  Authorization for incoming SOAP messages into BizTalk is also implemented via IIS.  I was pleased to see it&#8217;s pretty simple and thorough, once I actually found it.  The trick is not to look at the properties of the web app, but rather right-click and choose permissions.</p>
<div id="attachment_51" class="wp-caption alignnone" style="width: 206px"><a href="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_permissions1.png"><img class="size-full wp-image-51" title="2008_09_22_permissions1" src="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_permissions1.png?w=196&#038;h=241" alt="Authorization in IIS" width="196" height="241" /></a><p class="wp-caption-text">Authorization in IIS</p></div>
<div id="attachment_52" class="wp-caption alignnone" style="width: 378px"><a href="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authorization.png"><img class="size-full wp-image-52" title="2008_09_22_authorization" src="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authorization.png?w=368&#038;h=444" alt="IIS Authorization/Permissions" width="368" height="444" /></a><p class="wp-caption-text">IIS Authorization/Permissions</p></div>
<p>Now, here&#8217;s where permissions (authorization) are set.  Grayed out boxes indicate that the permissions are being inherited by a parent.  In the case of BizTalk, the default setting for web apps is to be deployed under the Default Web Site, listening on port 80.   If you stick with this default, you&#8217;ll want to be sure to use the minimal set of permissions at the parent, and be more specific for each web app underneath.  For example, if A and B are children of Default Web Site, you may likely want to have one set of permissions for A and separate permissions for B, meaning that you&#8217;ll want to limit the common permissions set by default at the parent.  And, if you didn&#8217;t guess already, you can&#8217;t use authorization (permissions) unless you authenticate a user using one of the methods described earlier (hence authorization w/anonymous access makes no sense).</p>
<p>Good luck!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/48/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/48/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/48/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=48&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2008/09/22/authentication-and-authorization-of-incoming-soap-requests-to-biztalk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authentication.png" medium="image">
			<media:title type="html">2008_09_22_authentication</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_permissions1.png" medium="image">
			<media:title type="html">2008_09_22_permissions1</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/09/2008_09_22_authorization.png" medium="image">
			<media:title type="html">2008_09_22_authorization</media:title>
		</media:content>
	</item>
		<item>
		<title>DTA Orphaned Instances</title>
		<link>http://fehlberg.wordpress.com/2008/08/05/dta-orphaned-instances/</link>
		<comments>http://fehlberg.wordpress.com/2008/08/05/dta-orphaned-instances/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 19:11:14 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=44</guid>
		<description><![CDATA[BizTalk Server 2006 (including R2 apparently &#8211; see warning section of this page) seems to have a bug, for which I&#8217;ve seen no fix, that affects the performance and size of the DTA (BizTalkDTADb) database because it fills it up with orphaned instances.  You can detect these using the following query:



select count(*) from [dbo].[dta_ServiceInstances]  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=44&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>BizTalk Server 2006 (including R2 apparently &#8211; <a href="http://technet.microsoft.com/en-us/library/aa578470.aspx">see warning section of this page</a>) seems to have a bug, for which I&#8217;ve seen no fix, that affects the performance and size of the DTA (BizTalkDTADb) database because it fills it up with orphaned instances.  You can detect these using the following query:</p>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td>select count(*) from [dbo].[dta_ServiceInstances]  where dtEndTime is NULL and [uidServiceInstanceId] NOT IN ( SELECT [uidInstanceID] FROM [MSGBOXSERVER].[BIZTALKMSGBOXDB].[dbo].[Instances]<br />
UNION<br />
SELECT [StreamID] FROM [MSGBOXSERVER].[BIZTALKMSGBOXDB].[dbo].[TrackingData]<br />
)</td>
</tr>
</tbody>
</table>
<p>These can also be detected by the <a href="http://blogs.technet.com/jpierauc/default.aspx">MsgBoxViewer</a>, a great tool that I&#8217;d recommend for all BizTalk administrators.</p>
<p>As you may be able to see from the query above, an orphaned instance is one that never finishes.  This can happen for a few, very common, reasons.  For example, an orchestration might throw an exception, or might be terminated by an administrator.  It seems silly to me that these stay in your DTA database forever, but nonetheless, they do.</p>
<p>So how do you fix this?  You can run this update command:</p>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td>UPDATE [dbo].[dta_ServiceInstances] SET [dtEndTime] = GetUTCDate() where dtEndTime is NULL and [uidServiceInstanceId] NOT IN ( SELECT [uidInstanceID] FROM [MSGBOXSERVER].[BIZTALKMSGBOXDB].[dbo].[Instances]<br />
UNION<br />
SELECT [StreamID] FROM [MSGBOXSERVER].[BIZTALKMSGBOXDB].[dbo].[TrackingData]<br />
)</td>
</tr>
</tbody>
</table>
<p class="posthead pageTitle">Here I had set [dtEndTime] = GetUTCDate() but you might want to change this after taking into consideration your &#8220;soft delete&#8221; date specified in your DTA purge job.  If you have a soft delete date of 14 days, for example,  you might want to set this to currentutcdate()-14 so that the next time the DTA purge and archive runs it will clear out these instances.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/fehlberg.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/fehlberg.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=44&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2008/08/05/dta-orphaned-instances/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>
	</item>
		<item>
		<title>Using MOM to Restart a BizTalk Server 2006 Host Instance Based on a Problem</title>
		<link>http://fehlberg.wordpress.com/2008/06/18/using-mom-to-restart-a-biztalk-server-2006-host-instance-based-on-a-problem/</link>
		<comments>http://fehlberg.wordpress.com/2008/06/18/using-mom-to-restart-a-biztalk-server-2006-host-instance-based-on-a-problem/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 18:18:46 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>
		<category><![CDATA[Microsoft Operations Manager (MOM)]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=38</guid>
		<description><![CDATA[A project that was deployed at work has a terrible tendency to freeze a host instance.  Once the problem occurs, the host instance sits in a zombie state until it is restarted.  The causes, which can be credited to 2 or 3 different bugs (out of our direct control), are being investigated (some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=38&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A project that was deployed at work has a terrible tendency to freeze a host instance.  Once the problem occurs, the host instance sits in a zombie state until it is restarted.  The causes, which can be credited to 2 or 3 different bugs (out of our direct control), are being investigated (some are described in my earlier posts), but we have at least 1 or 2 out there that haven&#8217;t yet been solved (and may not be).  So, we&#8217;d like the known errors to trigger a Microsoft Operations Manager (MOM) alert, which would have one of its responses be the execution of a script.</p>
<p>This sounds simple, right?  Well, not really.  I started with the RestartBizTalkHostInstances.vbs script installed with BizTalk Server (e.g. C:\Program Files\Microsoft BizTalk Server 2006\SDK\Samples\ApplicationDeployment\VisualStudioHostRestart).  Running the script didn&#8217;t work.  So I then did some searching and <a href="http://www.microsoft.com/technet/scriptcenter/topics/mom/mom1.mspx">found this helpful article</a>.  It taught me a thing or two, and I modified the script to avoid certain statements, like WScript.Echo.  Great.</p>
<p>But the script still didn&#8217;t work.  This is where things get interesting.  It turns out that MOM runs on the BizTalk Server (or any server for that matter) as the &#8220;Local System&#8221;.  So, to test a script, or find out what&#8217;s <em>really</em> wrong with it (other than some useless error in your event log), you need more information.  You can start out by running a command like this, &#8216;at &#8220;09:37&#8243; /interactive cmd.exe&#8217;.  This command, as written, will open up a command prompt at 9:37am that can be used to run other commands.  In this example, 9:37 happened to be 1 minute ahead of the then-current time.  After the new command line opens, you can now run scripts simulating the credentials MOM uses (this simulates the &#8220;local system&#8221; credentials, so potentially knowing this might help you in other problems you may have in the future). In my case, I received another error, which wasn&#8217;t particularly helpful.</p>
<p>So, what I did next was run &#8216;wbemtest&#8217;, which opens up a WMI testing utility.  This utility allows you to try executing WMI queries and the like, and instead of doing so via scripting, you have a GUI that aids in the process.</p>
<p><a href="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_wbemtest.gif"><img class="alignnone size-full wp-image-39" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_wbemtest.gif?w=454&#038;h=379" alt="Wbemtest Tool" width="454" height="379" /></a></p>
<p>By pressing &#8216;Connect&#8217; I can enter the namespace to connect to.  In my case the WMI script I&#8217;m trying to run shows:</p>
<p>Set objWMIService = GetObject(&#8220;winmgmts://./root/MicrosoftBizTalkServer&#8221;)</p>
<p>In the GUI you enter something slightly different&#8230;</p>
<p><a href="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_namespace.gif"><img class="alignnone size-full wp-image-40" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_namespace.gif?w=394&#038;h=436" alt="Specify WMI Namespace" width="394" height="436" /></a></p>
<p>After connecting, you can then try to simulate your WMI script.  Mine needs to run a query, so I press the Query button and copy from the WMI script:</p>
<p><a href="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_query.gif"><img class="alignnone size-full wp-image-41" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_query.gif?w=472&#038;h=175" alt="" width="472" height="175" /></a></p>
<p>When pressing &#8220;Apply&#8221; I got this error:</p>
<p><a href="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_error.gif"><img class="alignnone size-full wp-image-42" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_error.gif?w=358&#038;h=115" alt="WMI Script Error" width="358" height="115" /></a></p>
<p>If I press &#8220;More Information&#8221; and scroll down a bit, I find a property called &#8220;Description.&#8221;  Double clicking it shows this error:</p>
<pre>BizTalk Server cannot access SQL server.  This could be due to one of the following reasons:
1. Access permissions have been denied to the current user.  Either log on as a user that has been granted permissions to SQL and try again, or grant the current user permission to access SQL Server.
2. The SQL Server does not exist or an invalid database name has been specified.  Check the name entered for the SQL Server and database to make sure they are correct as provided during SQL Server installation.
3. The SQL Server exists, but is not currently running.  Use the Windows Service Control Manager or SQL Enterprise Manager to start SQL Server, and try again.
4. A SQL database file with the same name as the specified database already exists in the Microsoft SQL Server data folder.

Internal error from OLEDB provider: "Login failed for user '<strong>NT AUTHORITY\ANONYMOUS LOGON</strong>'."</pre>
<p>The interesting part of course is the last section, where it becomes apparent that anonymous credentials are trying to be used to run the script (and of course this is not allowed).  So what now?</p>
<p>If you go to the MOM folder in a command window, e.g. C:\Program Files\Microsoft Operations Manager 2005, and type &#8217;setactionaccount &lt;MOM Mgmt Group&gt; -query&#8217;, you will see the credentials used for the action account (if nothing shows up, you are running as local system). You can change this.  You can try setting the credentials using the &#8217;set&#8217; option of the same setactionaccount command.  This may or may not work depending on the MOM setup.  It didn&#8217;t work for me.</p>
<p>The other way to set this, is to use the MOM Administrator Console.  There you can find the agent computer, in this case the BizTalk Server, and specify the action account to be used for running scripts (and the like).  After doing this, you should be able to repeat the same comand, &#8217;setactionaccount &lt;MOM Mgmt Group&gt; -query&#8217; and you should see the new credentials that were set.  You may have to wait a minute for the change to take effect.</p>
<p>By the way, if you don&#8217;t know the &lt;MOM Mgmt Group&gt; you can find this by looking at the Console Settings of the Administrator or Operator console of MOM.</p>
<p>Once I did all of this, things starting working like a charm!  I hope this helps someone out there &#8211; let me know.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/fehlberg.wordpress.com/38/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/fehlberg.wordpress.com/38/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/38/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/38/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/38/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=38&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2008/06/18/using-mom-to-restart-a-biztalk-server-2006-host-instance-based-on-a-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_wbemtest.gif" medium="image">
			<media:title type="html">Wbemtest Tool</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_namespace.gif" medium="image">
			<media:title type="html">Specify WMI Namespace</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_query.gif" medium="image" />

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_18_error.gif" medium="image">
			<media:title type="html">WMI Script Error</media:title>
		</media:content>
	</item>
		<item>
		<title>BizTalk Singleton Orchestration Design</title>
		<link>http://fehlberg.wordpress.com/2008/06/06/biztalk-singleton-orchestration-design/</link>
		<comments>http://fehlberg.wordpress.com/2008/06/06/biztalk-singleton-orchestration-design/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 20:16:50 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=33</guid>
		<description><![CDATA[Here&#8217;s a white paper from Microsoft on creating sequential FIFO orchestrations (this applies to singletons as well), as a follow up to the blog I wrote a few days ago on poorly written singletons.  If you read the paper carefully, and pay attention to the &#8220;warning&#8221; sections, you&#8217;ll see that it&#8217;s actually very hard [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=33&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.microsoft.com/downloads/details.aspx?familyid=f4ff7afc-81a2-4b89-ae0d-3746b39d9198&amp;displaylang=en">Here&#8217;s a white paper</a> from Microsoft on creating sequential FIFO orchestrations (this applies to singletons as well), as a follow up to <a href="http://fehlberg.wordpress.com/2008/05/31/a-problem-with-biztalk-server-2006-performance-100-cpu-utilization/">the blog I wrote a few days ago on poorly written singletons</a>.  If you read the paper carefully, and pay attention to the &#8220;warning&#8221; sections, you&#8217;ll see that it&#8217;s actually very hard to create an orchestration that neatly ends with zero risk of losing messages.  This is because a message might come in after the listen shape, but before the orchestration has terminated.</p>
<p>To test this, I created a simple singleton orchestration that adds a deliberate wait of 2 minutes before finishing.</p>
<p style="text-align:center;"><img class="alignnone size-full wp-image-36" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_06_singleton1.gif?w=322&#038;h=547" alt="" width="322" height="547" /></p>
<p>I then deployed the orchestration, and starting sending in messages one by one (by the way, &#8220;Do Something&#8221; simply writes the one field in the message to the debugger).</p>
<p>So the message with value 1 was sent first, here&#8217;s the debugger output:</p>
<p>12880] Field was: 1</p>
<p>Then the message with value 2 was sent in, here&#8217;s the output:<br />
[12880] Field was: 2</p>
<p>Then, i waited about 45 seconds, just long enough to get us past the first Delay shape in the orchestration (of 30 seconds).  I submitted a message with value 3, but received no output (as expected).  I waited until the remaining time had finished and saw the orchestration suspend with this error:</p>
<p><img class="alignnone size-full wp-image-37" src="http://fehlberg.files.wordpress.com/2008/06/2008_06_06_unconsumed_message.gif?w=480&#038;h=178" alt="" width="480" height="178" /></p>
<p>The orchestration was not resumable.  I then sent in a message with value 4, here&#8217;s the output:<br />
[12880] Field was: 4</p>
<p>So, what does this prove?  If a message comes in before your orchestration has had the time to complete (and you&#8217;re no longer waiting to receive a message), you will have unprocessed messages in the orchestration when goes to complete.  I guess the good news is that you can see what that message was by clicking on the message tab, so if you&#8217;re willing to run this risk, you might go ahead with this decent, but not perfect, design.</p>
<p>To be absolutely fail-proof, the paper offers a few suggestions, such as stopping the receive location via wmi script as part of the shutdown process.  This is fine and all, except for this one question &#8211; how is it supposed to be turned back on? If you do this as part of the same orchestration, you have the same problem you started with!  I guess the one way this could be done would be by adding a &#8220;Start Orchestration&#8221; shape, which begins with a delay, and then enables the receive location again (the delay is to allow time for the calling orchestration to finish with no risk of losing messages).</p>
<p>Good luck!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/fehlberg.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/fehlberg.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=33&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2008/06/06/biztalk-singleton-orchestration-design/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_06_singleton1.gif" medium="image" />

		<media:content url="http://fehlberg.files.wordpress.com/2008/06/2008_06_06_unconsumed_message.gif" medium="image" />
	</item>
		<item>
		<title>Help w/BizTalk Server 2006/SQL Server Errors</title>
		<link>http://fehlberg.wordpress.com/2008/06/02/help-wbiztalk-server-2006sql-server-errors/</link>
		<comments>http://fehlberg.wordpress.com/2008/06/02/help-wbiztalk-server-2006sql-server-errors/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 16:34:17 +0000</pubDate>
		<dc:creator>Fehlberg Victor</dc:creator>
				<category><![CDATA[BizTalk Server]]></category>

		<guid isPermaLink="false">http://fehlberg.wordpress.com/?p=32</guid>
		<description><![CDATA[I&#8217;d like to see if someone out here has seen any of these errors before&#8230; I couldn&#8217;t find anything on the internet so far, but I imagine they have a common cause.  Ideas?



Severity:  Critical Error
Status:  New
Source:  BizTalk Server 2006
Name:  Critical Error: A stored procedure call failed.
Description:  The following stored [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=32&subd=fehlberg&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;d like to see if someone out here has seen any of these errors before&#8230; I couldn&#8217;t find anything on the internet so far, but I imagine they have a common cause.  Ideas?</p>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td><span style="font-size:7.5pt;font-family:'MS Sans Serif';">Severity:  Critical Error<br />
Status:  New<br />
Source:  BizTalk Server 2006<br />
Name:  Critical Error: A stored procedure call failed.<br />
Description:  The following stored procedure call failed: &#8221; { call [dbo].[bts_GetServiceStaticTrackingInfo]( ?)}&#8221;. SQL Server returned error string: &#8220;&#8221;.</span></td>
</tr>
</tbody>
</table>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td><span style="font-size:7.5pt;font-family:'MS Sans Serif';">Severity:  Critical Error<br />
Status:  New<br />
Source:  BizTalk Server 2006<br />
Name:  Critical Error: A stored procedure call failed.<br />
Description:  The following stored procedure call failed: &#8221; { call [dbo].[bts_InsertDynamicStateInfo_BizTalkServerApplication]( ?, ?, ?, ?, ?, ?, ?, ?)}&#8221;. SQL Server returned error string: &#8220;&#8221;.</span></td>
</tr>
</tbody>
</table>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td><span style="font-size:7.5pt;font-family:'MS Sans Serif';">Severity:  Critical Error<br />
Status:  New<br />
Source:  BizTalk Server 2006<br />
Name:  Critical Error: A stored procedure call failed.<br />
Description:  The following stored procedure call failed: &#8221; { call [dbo].[bts_GetDynamicStateInfo_BizTalkServerApplication]( ?, ?, ?)}&#8221;. SQL Server returned error string: &#8220;&#8221;.</span></td>
</tr>
</tbody>
</table>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td><span style="font-size:7.5pt;font-family:'MS Sans Serif';">Severity:  Critical Error<br />
Status:  New<br />
Source:  BizTalk Server 2006<br />
Name:  Critical Error: A stored procedure call failed.<br />
Description:  The following stored procedure call failed: &#8221; { call [dbo].[bts_CreateSubscription_ACCISHost]( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}&#8221;. SQL Server returned error string: &#8220;Cannot create new connection because in manual or distributed transaction mode.&#8221;.</span></td>
</tr>
</tbody>
</table>
<table border="0" bgcolor="#eeeeee">
<tbody>
<tr>
<td><span style="font-size:7.5pt;font-family:'MS Sans Serif';">Severity:  Critical Error<br />
Status:  New<br />
Source:  BizTalk Server 2006<br />
Name:  Critical Error: A stored procedure call failed.<br />
Description:  The following stored procedure call failed: &#8221; { call admsvr_SendPortToPEP( ?)}&#8221;. SQL Server returned error string: &#8220;&#8221;.</span></td>
</tr>
</tbody>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/fehlberg.wordpress.com/32/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/fehlberg.wordpress.com/32/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fehlberg.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fehlberg.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fehlberg.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fehlberg.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fehlberg.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fehlberg.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fehlberg.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fehlberg.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fehlberg.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fehlberg.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fehlberg.wordpress.com&blog=2085701&post=32&subd=fehlberg&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://fehlberg.wordpress.com/2008/06/02/help-wbiztalk-server-2006sql-server-errors/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/787d50e6869afe59c4c1e8b437497b9f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Victor Fehlberg</media:title>
		</media:content>
	</item>
	</channel>
</rss>