<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-29598966</id><updated>2012-02-17T01:56:28.200Z</updated><category term='C#'/><category term='Visual Studio'/><category term='Team Foundation Server'/><category term='design patterns'/><category term='XSD'/><category term='MVC'/><category term='WCF'/><category term='TFS'/><category term='ESB'/><category term='.Net'/><category term='SQL Server'/><category term='deployment'/><category term='BizTalk'/><category term='Branching'/><category term='TFS2010'/><category term='NHibernate'/><category term='Event Log'/><category term='source control'/><category term='XML'/><category term='Windows 2008'/><category term='ASP.Net'/><category term='SSIS'/><category term='Merging'/><title type='text'>Andrew Rivers</title><subtitle type='html'>software stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default?start-index=26&amp;max-results=25'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29598966.post-6538463072444301287</id><published>2010-06-24T10:19:00.004Z</published><updated>2010-06-24T10:28:47.115Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='TFS2010'/><title type='text'>Using Team Foundation Server 2010 from Visual Studio 2005 and 2008</title><content type='html'>On my project the TFS server has just been upgraded, ready for us to replatform the software onto .Net 4.0.  In the meantime we're still working on a mixture of Visual Studio 2005 (for BizTalk 2006 R2) and Visual Studio 2008 (for the rest of the .Net and database code).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Team Foundation Server 2010 is not compatible with Visual Studio / Team Explorer 2005 and 2008 without the compatibility upgrade.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order to install the compatibility pack for Visual Studio 2008 go here:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=CF13EA45-D17B-4EDC-8E6C-6C5B208EC54D&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=CF13EA45-D17B-4EDC-8E6C-6C5B208EC54D&amp;amp;displaylang=en&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order to install the compatibility for Visual Studio 2005 go here:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=22215E4C-AF6F-4E2F-96DF-20E94D762689&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=22215E4C-AF6F-4E2F-96DF-20E94D762689&amp;amp;displaylang=en&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Workspace issues&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once you have connected to the new TFS server and mapped your projects back, you should be able to map your workspaces without any problems.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, you might find that your workspaces do not work.  This is especially an issue in Visual Studio 2005, which seems not to recognise the workspace that you have reapped the workspace.  If this is the case, run the following command from the VS2005 Command Prompt:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;tf.exe workspaces /remove:*&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then get latest on your source branch.  It should be OK.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-6538463072444301287?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/6538463072444301287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=6538463072444301287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6538463072444301287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6538463072444301287'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2010/06/using-team-foundation-server-2010-from.html' title='Using Team Foundation Server 2010 from Visual Studio 2005 and 2008'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-8877026545905433132</id><published>2010-02-23T10:04:00.002Z</published><updated>2010-02-23T10:11:14.907Z</updated><title type='text'>The endless debate on "what is an architect"</title><content type='html'>Just been following the following debate in LinkedIn: &lt;a href="http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers&amp;discussionID=13839089&amp;gid=100988&amp;commentID=12211252&amp;trk=view_disc"&gt;http://www.linkedin.com/groupAnswers?viewQuestionAndAnswers&amp;discussionID=13839089&amp;gid=100988&amp;commentID=12211252&amp;trk=view_disc&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The discussion started with the following comment:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;This is what is killing Enterprise Architecture… &lt;br /&gt;Quote from "John Zachman" article..;-)&lt;br /&gt;This is what is killing Enterprise Architecture… every computer programmer, systems designer, software architect, solutions architect, technology architect, computer operator, PC owner, data architect, database architect, network architect, business analyst, systems analyst, enterprise architect, service architect, object architect, project manager and CIO calls whatever they want to or maybe, whatever they are doing, “Architecture.” It is chaos. No wonder we don’t have Enterprises that are coherent, integrated, flexible, dynamic, interoperable, reusable, aligned, lean and mean and working. &lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;And I thought I'd add my bit as well.....&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;I love this discussion, if only because it goes round in circles so much. Getting back to the original point though: &lt;br /&gt;&lt;br /&gt;"....calls whatever they want to or maybe, whatever they are doing, “Architecture.”" &lt;br /&gt;&lt;br /&gt;This gets to the nub of the problem. Quite simply, you are an architect if the role you perform is "architecture". However, people do indeed hijack the term to make their own role sound better. We cannot rely on some higher authority to define for us what an architect is and then impose a set of criteria to test against. Instead it is incumbent upon all of us who consider ourselves to be architects to explain what architecture involves and if we suspect others of "job title inflation" we should ask what they have done that qualifies as architecture. &lt;br /&gt;&lt;br /&gt;As a marker, I think there are some fundamental aspects of architecture that we should be able to agree on: &lt;br /&gt;&lt;br /&gt;* Architecture is a high-level design activity. The output of architecture is a design of some sort, although this can vary enormously in the level of abstraction. Architecture is the synthesis of a design that satisfies a set of requirements. &lt;br /&gt;&lt;br /&gt;* A secondary activity of an architect is communication of the design and the supervision of the detailed design and implementation to ensure that the design intent has been captured. &lt;br /&gt;&lt;br /&gt;* Another secondary activity of an architect is to communicate to those creating requirements what the impact of their requirements will be on the design and to advise on improvements. &lt;br /&gt;&lt;br /&gt;Someone whose primary role is development / implementation / operations is not therefore an architect. I think "enterprise" architecture vs other types of architecture is a red herring in this regard. These are all valid disciplines - there are indeed "data architects", there are indeed "infrastructure architects" and there are indeed "enterprise architects". The key thing is that in each case the primary goal of their activity is design.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;You've got to love it.  I haven't seen a more circular debate since the old artists vs scientists one that you have at university!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-8877026545905433132?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/8877026545905433132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=8877026545905433132' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8877026545905433132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8877026545905433132'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2010/02/endless-debate-on-what-is-architect.html' title='The endless debate on &quot;what is an architect&quot;'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-4819690279715435852</id><published>2010-01-07T13:49:00.002Z</published><updated>2010-01-07T14:01:00.305Z</updated><title type='text'>User-Defined Functions for Today and Tomorrow in SQL</title><content type='html'>Just a quick post today.  I have been working on some bugs on a system were about to release, which was originally built by some dodgy developer before we took it over.  The older reaches of the application are a total mishmash f things that should be in the database, data access layer, business logic layer and in the UI, so please don't flame me with comments like "you shouldn't be doing this in the database, it should be in the ......".&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the features that I was fixing was a view that contains the current effective price for a product.  Imagine that you have a table that contains prices, and when a price changes you insert a new row with the updated price and an effective date.  Simple stuff - the current price is the one with the most recent effective date that is either today or in the past, i.e. before tomorrow.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, SQL server is a pain in the ass when it comes to simple date stuff like this, because all I want is something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;SELECT &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;TOP 1 * &lt;/div&gt;&lt;div&gt;FROM &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ProductPrice &lt;/div&gt;&lt;div&gt;WHERE &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ProductID = @ProductID &lt;/div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;AND EffectiveDate &lt;&gt;&lt;div&gt;ORDER BY &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;EffectiveDate DESC&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I therefore wrote a couple of functions to achieve this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;CREATE FUNCTION [dbo].[Today]()&lt;/div&gt;&lt;div&gt;RETURNS datetime&lt;/div&gt;&lt;div&gt;AS&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;DECLARE @today datetime;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET @today = convert(datetime, convert(varchar(10),getdate(),101), 101);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;RETURN @today;&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;CREATE FUNCTION [dbo].[Tomorrow]()&lt;/div&gt;&lt;div&gt;RETURNS datetime&lt;/div&gt;&lt;div&gt;AS&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;DECLARE @tomorrow datetime;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET @tomorrow = convert(datetime, convert(varchar(10),getdate(),101), 101);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET @tomorrow = DATEADD(d, 1, @tomorrow);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;RETURN @tomorrow;&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Enjoy :)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-4819690279715435852?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/4819690279715435852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=4819690279715435852' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/4819690279715435852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/4819690279715435852'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2010/01/user-defined-functions-for-today-and.html' title='User-Defined Functions for Today and Tomorrow in SQL'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-2939088698173801</id><published>2009-12-09T16:26:00.004Z</published><updated>2009-12-09T17:38:40.418Z</updated><title type='text'>Note to Self:  MQSeries</title><content type='html'>I've been off working on another project for a very busy 3 weeks (more on this perhaps in the next post) and have now returned back onto the project I was on since July.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a quick note to self for when the password on the service account for IBM MQSeries needs to be changed.  When the password expired I got an error message like this when I tried to start a queue manager:&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#FF0000;"&gt;Initialization of resource 'amqmsrvn' failed, rc=0x8000401a&lt;br /&gt;The server process could not be started because the configured identity is incorrect. Check the username and password.&lt;br /&gt;exitvalue = -4&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="mso-ansi-language:EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;I then got the resolution from here: &lt;a href="http://ecommunity.groupintelligence.com/websphere/forums/showthread.php?t=2036"&gt;http://ecommunity.groupintelligence.com/websphere/forums/showthread.php?t=2036&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, you need to change the service account / password on the IBM MQSeries windows service (from the Services MMC):&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TRDeiMVJzrs/Sx_fnAF0T-I/AAAAAAAAADA/BmCPu55e6K4/s1600-h/ComPlus2.png"&gt;&lt;img src="http://2.bp.blogspot.com/_TRDeiMVJzrs/Sx_fnAF0T-I/AAAAAAAAADA/BmCPu55e6K4/s400/ComPlus2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5413291138254917602" style="cursor: pointer; width: 361px; height: 400px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And second you need to go into Component Services (COM+) and find the "IBM MQSeries Services" in the DCOM Config node:&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/Sx_fm1ZSQgI/AAAAAAAAAC4/xT05Sp_CfjA/s1600-h/ComPlus.png"&gt;&lt;img src="http://3.bp.blogspot.com/_TRDeiMVJzrs/Sx_fm1ZSQgI/AAAAAAAAAC4/xT05Sp_CfjA/s400/ComPlus.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5413291135383781890" style="cursor: pointer; width: 400px; height: 279px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And then update the password in the "Log On" tab.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TRDeiMVJzrs/Sx_ff01ESMI/AAAAAAAAACw/5fSjecqCZN0/s1600-h/Services.png"&gt;&lt;img src="http://1.bp.blogspot.com/_TRDeiMVJzrs/Sx_ff01ESMI/AAAAAAAAACw/5fSjecqCZN0/s400/Services.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5413291014972786882" style="cursor: pointer; width: 356px; height: 400px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hopefully I won't waste an hour rebuilding my queues next time!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-2939088698173801?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/2939088698173801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=2939088698173801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2939088698173801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2939088698173801'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/12/note-to-self-mqseries.html' title='Note to Self:  MQSeries'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_TRDeiMVJzrs/Sx_fnAF0T-I/AAAAAAAAADA/BmCPu55e6K4/s72-c/ComPlus2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-6596614236231113416</id><published>2009-11-05T11:43:00.013Z</published><updated>2009-11-08T14:22:48.090Z</updated><title type='text'>Use of generic types in BizTalk and XLANG/s</title><content type='html'>This is just a quick post to note down something that I have been explaining to people lately.  The project I am working on at the moment has several teams of developers working together and most of the code is being cut in Visual Studio 2008 / .Net 3.5.  As such, we in the BizTalk feature team are taking delivery of components coded in other teams and integrating them.  We are using BizTalk 2006 R2 and developing the BizTalk orchestrations in Visual Studio 2005, although there are no compatability issues between the binaries developed in 2008 and 2005, and anyway generic types were introduced in 2005 / .Net 2.0.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, where I have come across an issue is in the use of generic types, and specifically assigning generic types to orchestration variables.  In some cases orchestrations and expression shapes support generics and in some cases they do not.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All I am going to do is to illustrate some cases where generics are OK and some where they are not, with a bit of explanation as to why.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Assigning to variables&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Imagine that you have a class:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public class MyClass {}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And you want to use a collection of this class in your code, these days you would usually use a generic collection in our code:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;Collection&lt;myclass&gt; collection = new Collection&amp;lt;MyClass&amp;gt;&lt;myclass&gt;&lt;myclass&gt;();&lt;/myclass&gt;&lt;/myclass&gt;&lt;/myclass&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, if you try to assign this type to a variable in an orchestration you will find that you can't.  This is because you can only pick from a type that is compiled, and generic types aren't in there.  If you want to use a collection like this in an orchestration you will have to create a type for it.  You can define a new class:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public class MyClassCollection : Collection&amp;lt;MyClass&amp;gt;&lt;myclass&gt; {}&lt;/myclass&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you do this, you can reference "MyClassCollection" as a variable in your orchestration and everything will be fine.  Note that the usual rules about classes being marked as serializable apply.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The same applies if you create a class that has a generic interface such as this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"  style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;namespace&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; AndrewGenerics.Components&lt;br /&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Serializable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;]&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;OrchestrationInstanceHelper&amp;lt;T&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;t&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;public&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; UpdateInstance(T objectInstance)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CC00;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;// Some code in here &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/t&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;If you see this class in the type picker and try to assign it to a variable you will be able to pick it:&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TRDeiMVJzrs/SvbSVuab8yI/AAAAAAAAACo/pWtQrcQMu7c/s1600-h/Type+Picker.png"&gt;&lt;img src="http://2.bp.blogspot.com/_TRDeiMVJzrs/SvbSVuab8yI/AAAAAAAAACo/pWtQrcQMu7c/s400/Type+Picker.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401736073755489058" style="cursor: pointer; width: 400px; height: 318px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However you will not be able to assign the generic type:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TRDeiMVJzrs/SvbSSEzZt8I/AAAAAAAAACg/1E-GYNICxVM/s1600-h/OrchWithType.png"&gt;&lt;img src="http://2.bp.blogspot.com/_TRDeiMVJzrs/SvbSSEzZt8I/AAAAAAAAACg/1E-GYNICxVM/s400/OrchWithType.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5401736011046303682" style="cursor: pointer; width: 400px; height: 335px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a result if you try to compile you will get a whole heap of errors like these:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      1              '` (0x60)': character cannot appear in an identifier                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  62           63           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      2              '` (0x60)': character cannot appear in an identifier                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           80           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      3              identifier 'OrchestrationInstanceHelper' does not exist in 'AndrewGenerics.Components'; are you missing an assembly reference?               C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  62           36                &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      4              cannot find symbol 'AndrewGenerics.Components.OrchestrationInstanceHelper'                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  62           36           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      5              expected 'identifier'       C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  62                64           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      6              unexpected token: 'numeric-literal'                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  62           64           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      7              identifier 'helper' does not exist in 'TestOrchestration'; are you missing an assembly reference?                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           14           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      8              cannot find symbol 'helper'                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           14           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      9              identifier 'OrchestrationInstanceHelper' does not exist in 'AndrewGenerics.Components'; are you missing an assembly reference?               C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           53                &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      10           cannot find symbol 'AndrewGenerics.Components.OrchestrationInstanceHelper'                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           53           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      11           'new OrchestrationInstanceHelper': a new expression requires () after type                C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67           23           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      12           expected 'identifier'       C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67                82           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      13           unexpected token: '('    C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67                82           &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      14           illegal statement '1'         C:\Projects\AndrewGenerics\AndrewGenerics.BizTalk\TestOrchestration.odx  67                81    &lt;/span&gt;       &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;All those errors are because of a couple of things, but mainly because when you add a variable to an orchestration, or add code in an expression shape, the designer writes some C# code for you and then compiles it.  Because the way that the designer handles generics is incorrect the C# doesn't compile and you get the build errors.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Again though, if you created a class that inherited from the above class and assigned the generic type you'd be OK:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public class MyClassInstanceHelper : OrchestrationInstanceHelper&amp;lt;MyClass&amp;gt; {}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Passing parameters to methods&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;OK. Let's now create a helper component that we will call from an orchestration.  &lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;&lt;i&gt;[Disclaimer: The code below if for illustration purposes only!]&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span lang="EN-GB"   style="font-family:&amp;quot;;color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-style-span"  style="color:#000000;"&gt;&lt;br /&gt;&lt;/span&gt;namespace&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB"  style="font-family:&amp;quot;;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; AndrewGenerics.Components&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"  style="font-family:&amp;quot;;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;{&lt;br /&gt;&lt;/span&gt;    &lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;class&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;OrchestrationHelper&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"  style="font-family:&amp;quot;;"&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CC00;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;// Note that this uses the collection type&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; UpdateItemsInCollection(&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClassCollection&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; collection)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CC00;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;// Some code in here &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;  &lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CC00;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;// Note that this uses the generic type&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; UpdateItemsInCollection2(&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;IEnumerable&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;&lt;/span&gt;&lt;span style="color:#2B91AF;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClass&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&gt; collection)&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;{&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="color:#33CC00;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;// Some code in here&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;            &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;   &lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: normal; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;The first of these calls uses the inherited type and so will go through no problem:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;AndrewGenerics.Components.OrchestrationHelper.UpdateItemsInCollection(myCollection);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But even if we use the second of the method calls with the IEnumerable&amp;lt;MyClass&amp;gt; parameter, that still works OK:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 102, 255); "&gt;AndrewGenerics.Components.OrchestrationHelper.UpdateItemsInCollection2(myCollection);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Therefore, even though the method in a helper component has a generic type in the code, when the class is compiled the generic type gets "baked" into the interface and so the variable assignment works.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Assigning output from methods to variables&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now let's add another method onto the helper class that we can use to receive a collection of objects, but again through a generic type.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'Courier New';"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;        &lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;IEnumerable&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClass&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&gt; GetCollection()&lt;br /&gt; {&lt;br /&gt;&lt;/span&gt;            &lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Collection&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClass&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&gt; coll = &lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Collection&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClass&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&gt;();&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;coll.Add(&lt;/span&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175); "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;MyClass&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;());&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;            &lt;span style="color:blue;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt; coll;&lt;br /&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In order to call this I might use a line of code like this in an expression shape:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"  style="font-family:&amp;quot;;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;myCollection = (AndrewGenerics.Components.MyClassCollection)AndrewGenerics.Components.OrchestrationHelper.GetCollection();&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-GB" style="mso-ansi-language:EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;Again, this is handled OK by the BizTalk compiler when we are assigning to our collection and the we are casting the type of the result.  For the same reasons as above, we can't create a variable of IEnumerable&amp;ltMyClass;&amp;gt;&lt;myclass&gt; so we can't receive the output of this method without casting it, but we can at least handle it.  Obviously, if at runtime we were presented with a different object that conformed to IEnumerable&amp;ltMyClass;&amp;gt; (such as an array) we would get a runtime error because of an invalid cast.&lt;/myclass&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, we have been able to declare a method that uses a generic type, and for the same reason we can use it, i.e. when the helper component is compiled the method signature becomes fixed and the orchestration compiler can handle the output.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Conclusions&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are some key points from this blog post:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;You cannot declare  generic type in an orchestration because you can only select types in the type picker.  If you select a generic interface that does not have the type assigned you get some crazy errors.&lt;/li&gt;&lt;li&gt;In order to use a generic type you can create a class that implements the generic type.  This will then be usable by BizTalk.&lt;/li&gt;&lt;li&gt;When a helper component uses generic types in the interface the types get baked into the interface and can be used by BizTalk.&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-6596614236231113416?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/6596614236231113416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=6596614236231113416' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6596614236231113416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6596614236231113416'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/11/use-of-generic-types-in-biztalk-and.html' title='Use of generic types in BizTalk and XLANG/s'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_TRDeiMVJzrs/SvbSVuab8yI/AAAAAAAAACo/pWtQrcQMu7c/s72-c/Type+Picker.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-583882757796637552</id><published>2009-11-04T16:55:00.006Z</published><updated>2009-11-04T17:01:28.982Z</updated><title type='text'>Am I missing something?</title><content type='html'>&lt;div&gt;I was shopping on Amazon for my son's Christmas present this afternoon.  He wants a laptop and I was looking for an entry-level laptop that is running Windows 7.  I found this nice looking Compaq Presario:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/SvGyZJRHgeI/AAAAAAAAACQ/4vUpBBboZsI/s1600-h/Laptop.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 235px;" src="http://3.bp.blogspot.com/_TRDeiMVJzrs/SvGyZJRHgeI/AAAAAAAAACQ/4vUpBBboZsI/s400/Laptop.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5400293573248123362" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;However, when I scrolled down on the description I found the following:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/SvGy8_sA58I/AAAAAAAAACY/z7UShf1DBDY/s1600-h/Dawn.bmp"&gt;&lt;img src="http://3.bp.blogspot.com/_TRDeiMVJzrs/SvGy8_sA58I/AAAAAAAAACY/z7UShf1DBDY/s400/Dawn.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5400294189151872962" style="cursor: pointer; width: 400px; height: 216px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That's it.  The only thing that other people have bought.  I was expecting to see antivirus and MS Office!  Just shows that you can't assume what choices the public will make!&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-583882757796637552?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/583882757796637552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=583882757796637552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/583882757796637552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/583882757796637552'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/11/am-i-missing-something.html' title='Am I missing something?'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_TRDeiMVJzrs/SvGyZJRHgeI/AAAAAAAAACQ/4vUpBBboZsI/s72-c/Laptop.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-5118708955624531402</id><published>2009-10-29T21:12:00.002Z</published><updated>2009-10-29T21:30:30.198Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>BizTalk Orchestration Designer Crashes Visual Studio</title><content type='html'>This is just a quick post to note in passing an issue that I encountered recently.  In my current project I am again working as a BizTalk architect, and we are using BizTalk Server 2006 R2, and hence the designer is hosted in Visual Studio 2005.  After taking over some enormous orchestrations from another member of the team recently I started to find that Visual Studio started crashing often and unpredictably.  So much so, in fact, that I had to press ctrl+S after just about every shape change, as I was losing work so often.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, I had worked on a project a couple of years ago where we suffered this a lot.  I think that one was BizTalk Server 2006 R1.  After having done some stints with BizTalk 209 / VS 2008 it came as a nasty surprise to be getting this issue again.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you might expect, I decided to search to see who else had had the same issue.  I got a couple of relevant hits.  This one, &lt;a href="http://continuouslyintegrating.blogspot.com/2008/01/orchestration-designer-crashes-visual.html"&gt;http://continuouslyintegrating.blogspot.com/2008/01/orchestration-designer-crashes-visual.html&lt;/a&gt;, was interesting as it implied that there was something in your profile that was causing the issue.  I didn't really want to have to rebuild a profile in the middle of a critical phase in the project so I kept searching.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then came across this one, &lt;a href="http://www.sabratech.co.uk/blogs/yossidahan/labels/visual%20studio.html"&gt;http://www.sabratech.co.uk/blogs/yossidahan/labels/visual%20studio.html&lt;/a&gt;, and more things to try.  The thing that seemed to be intuitively right was that the size of the orchestration might be an issue.  I had only started experiencing issues once I started to work on huge orchestrations.  Before that there had been no problem.  When working on modest orchestrations there was no problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I therefore took the suggestion that had the least amount of pain, to decrease the colour depth in my display settings from 32-bit down to 16-bit.  I was hoping that this was going to do the trick.  I then started working on the offending orchestrations and I could at least get started, but I did experience further crashes.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then thought of a further step I might take, and it seemed to follow on from reducing the graphics load.  I zoomed out.  Never had another crash after that!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think part of the problem is that the orchestration designer renders the orchestration as an image, or rather as a series of overlapping images.  Then, depending on where you scroll to, a certain &lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;portion&lt;/span&gt; of the image is displayed.  Therefore, no matter how small your viewing area in the designer the orchestration designer is still rendering a pretty big image. However, if you scroll out you reduce the overall size f the image that needs to be rendered.  And, as mentioned, if you decrease the colour depth you reduce the size of it still further.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Huge orchestrations, from a design point of view, are bad.  Huge orchestrations, from the Visual Studio Orchestration Designer point of view, are bad.  If you must have them (as in my case where I was handed them and had to make them work), reducing the graphics load on your machine is a quick way to prevent Visual Studio from crashing under the load.&lt;/div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB" style="mso-ansi-language:EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB" style="mso-ansi-language:EN-GB"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-5118708955624531402?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/5118708955624531402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=5118708955624531402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5118708955624531402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5118708955624531402'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/biztalk-orchestration-designer-crashes.html' title='BizTalk Orchestration Designer Crashes Visual Studio'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-1938719231666182418</id><published>2009-10-20T09:14:00.004Z</published><updated>2009-10-22T15:53:31.770Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Use of interfaces within BizTalk Orchestrations and XLANG/s</title><content type='html'>&lt;div&gt;&lt;b&gt;Abstract&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This blog post discusses the way in which interfaces are handled in BizTalk.  In particular, the reason why variables defined by interfaces cannot be saved to orchestration state.  This causes a compiler error &lt;i&gt;[&lt;/i&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri, sans-serif;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;a non-serializable object type '{type name} {variable name}' can only be declared within an atomic scope or service ]&lt;/span&gt;&lt;/i&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Calibri, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;Introduction&lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;&lt;/span&gt;I have recently been working back on BizTalk, and I have come across a strange issue with the way that interfaces are handled by the BizTalk compiler.  As usual, this is of interest not only because there are people who may encounter this issue, but also because of the implications it has for understanding how the BizTalk orchestration engine works.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's consider a scenario:  You want to encapsulate a common sub-process within a single orchestration.  You need to invoke some business logic within this sub-process and this may change depending on which orchestration has invoked the sub-process.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my case I decided to use a factory pattern, so I created an interface for the business logic and then the orchestration invoked the factory to receive the correct business logic instance.  I have created a simplified example project to demonstrate the issue.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Example Solution&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First, I created an interface that defines how the business logic is to be called:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    public interface IOrchestrationHelper&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        void DoStuff();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then created a base class (more on this later):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    [Serializable]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    public class OrchestrationHelperBase : IOrchestrationHelper&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        #region IOrchestrationHelper Members&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        public virtual void DoStuff()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            throw new Exception("The method or operation is not implemented.");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        #endregion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And then I created 2 implementations of the class:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    public class OrchestrationHelperA : OrchestrationHelperBase&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        public override void DoStuff()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            Debug.WriteLine("This is OrchestrationHelperA");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    [Serializable]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    public class OrchestrationHelperB : OrchestrationHelperBase&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        public override void DoStuff()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            Debug.WriteLine("This is OrchestrationHelperB");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And the factory to instantiate the classes:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;    &lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;public static class OrchestrationHelperFactory&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        public static IOrchestrationHelper CreateHelper(string helperName)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            switch (helperName)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                case "A":&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                    return new OrchestrationHelperA();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                case "B":&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                    return new OrchestrationHelperB();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                default:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;                    throw new Exception("Could not match a helper to the input specification.");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;            }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;        }&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;    }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;OK, so far so good.  Simple stuff, we do this sort of thing every day don't we?  This needed to be hooked into the BizTalk processes, so I incorporated the calls to the factory and the business logic into an orchestration, as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_TRDeiMVJzrs/St3EPjZUEUI/AAAAAAAAACI/e3WJtYuGwq8/s1600-h/InterfacesXLANGs.bmp"&gt;&lt;img src="http://2.bp.blogspot.com/_TRDeiMVJzrs/St3EPjZUEUI/AAAAAAAAACI/e3WJtYuGwq8/s400/InterfacesXLANGs.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5394683700138217794" style="cursor: pointer; width: 400px; height: 335px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you look at the orchestration, I have a parameter called helperSpecification of type System.String that is passed in by the caller, which defines the piece of business logic to invoke (in practice this would possibly be an enum, but this is just to demonstrate).  There is also an orchestration parameter called orchestrationHelper of type IOrchestrationHelper that contains the instance of the business logic component.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the first expression shape I create the orchestration helper:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;orchestrationHelper = Andrew.InterfacesXLANGs.Components.OrchestrationHelperFactory.CreateHelper(helperSpecification);&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;And in the next expression shape I call the business logic:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span lang="EN-GB"&gt;&lt;span class="Apple-style-span"  style="color:#3366FF;"&gt;orchestrationHelper.DoStuff();&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Again, this is almost as simple an orchestration as it is possible to get.  However, when I try to compile it I get the following error:&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Error      1              a non-serializable object type 'Andrew.InterfacesXLANGs.Components.IOrchestrationHelper orchestrationHelper' can only be declared within an atomic scope or service       C:\Documents and Settings\v-anriv\My Documents\Visual Studio 2005\Projects\InterfacesXLANGs\InterfacesXLANGs\SubProcess.odx               46           66&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal"&gt;Now, if you look into the cause of this error it is quite simple.  BizTalk is a reliable messaging and orchestration server; the mechanism for achieving this reliability is that the state of messages and orchestrations is persisted to the Message Box database at runtime, either at persistence points (send ports, timeouts, exiting atomic scopes) or when the service decides to save the state to manage load.  This is where the issue lies.  In order to save the state of a variable it must be marked as serializable.  When an orchestration hits a persistence point it serializes all of its variables and saves the data into the database.  When the orchestration is "rehydrated", the state is deserialized and the processing can continue.&lt;/p&gt;&lt;p class="MsoNormal"&gt;I mentioned scopes just above.  Atomic scopes are a special case in BizTalk.  These are the scopes in which an atomic (MSDTC) transaction is running.  Obviously, in order to marshal the resources for such a transaction the orchestration must remain in memory during the processing of an atomic scope.  This means that the scope must complete, or if it fails half way through BizTalk will assume that the work in the atomic scope has not been done, and will attempt to re-run it when the orchestration is started.  &lt;/p&gt;&lt;p class="MsoNormal"&gt;A side-effect of atomic scopes is that variables that are defined in an atomic scope will never be persisted to the database as they will always be in memory until the scope is complete.  Because of this, it is possible to define a variable that is a non-serializable class.&lt;/p&gt;&lt;p class="MsoNormal"&gt;As you can imagine, when a BizTalk host is running an orchestration t is just like any process executing code.  However, when a persistence point is reached there is a double-hit on the performance as the state is serialized and is then saved into the message box database as a recoverable state point.  This increased the latency of the orchestration considerably, and if throughput performance is an issue then you should minimise the number of persistence points.  If you are more concerned with reliability then it's not such a bad thing.&lt;/p&gt;&lt;p class="MsoNormal"&gt;If you look at the classes I defined they were all marked as serializable, so they could all happily exist in BizTalk orchestrations.  However, because the variable was defined to use the interface, the compiler did not know if the class that would implement the interface would also be marked as serializable, therefore it generated an error.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;The Solution, and some words of warning&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;In order to allow the BizTalk compiler to be fooled into accepting the interface, you need to declare the variable as the base class, and mark the base class as serializable.  But be careful, if you do anything in your subclasses to make them non-serializable then there will be some unfortunate unintended consequences when the object is instantiated by the factory and loaded into the orchestration state.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;I have used an example where an interface is used in a declaration in BizTalk to illustrate how BizTalk manages orchestration state through serialization of the orchestration variables.  If you think about why and where orchestrations serialize and persist / dehydrate / rehydrate you will also start to get a grip on the factors that affect orchestration performance, and you can alter your designs to suit.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-1938719231666182418?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/1938719231666182418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=1938719231666182418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1938719231666182418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1938719231666182418'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/use-of-interfaces-within-biztalk.html' title='Use of interfaces within BizTalk Orchestrations and XLANG/s'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_TRDeiMVJzrs/St3EPjZUEUI/AAAAAAAAACI/e3WJtYuGwq8/s72-c/InterfacesXLANGs.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-1109930686551349606</id><published>2009-10-14T20:45:00.002Z</published><updated>2009-10-14T20:45:27.775Z</updated><title type='text'>Just read this somewhere....</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: rgb(51, 51, 51); "&gt;"A computer without COBOL or FORTRAN is like a chocolate cake without ketchup or mustard"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-1109930686551349606?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/1109930686551349606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=1109930686551349606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1109930686551349606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1109930686551349606'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/just-read-this-somewhere.html' title='Just read this somewhere....'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-6026703107374694668</id><published>2009-10-08T13:17:00.002Z</published><updated>2009-10-08T13:23:12.152Z</updated><title type='text'>Reminder : Fusion Log Viewer</title><content type='html'>Just a quick note - been having some errors loading assemblies lately and have called on the little-known tool in the SDK called Fusion Log Viewer.  You can load it from the Visual Studio Command Prompt using the command fuslogvw or load it from here:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;p class="MsoNormal"&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\ FUSLOGVW.exe&lt;/p&gt;&lt;p class="MsoNormal"&gt;You'll get a view of all assembly load failures, which is really useful with systems that dynamically load stuff from the GAC at runtime such as BizTalk.  &lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-6026703107374694668?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/6026703107374694668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=6026703107374694668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6026703107374694668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/6026703107374694668'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/reminder-fusion-log-viewer.html' title='Reminder : Fusion Log Viewer'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-2807819557775125811</id><published>2009-10-07T10:38:00.004Z</published><updated>2009-10-07T12:29:18.547Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><title type='text'>BizTalk Error: Failed while delivering a message to a service instance. Message details follow.</title><content type='html'>I had a strange error in BizTalk this week.  I was integrating some changes by the database team on my project, and I got a strange error condition that I had not seen before.  The symptoms were as follows:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;(Normal functionality): Orchestration extracts an entity from the data access layer, and uses a Start Orchestration shape to launch another orchestration, passing the entity as a parameter.&lt;/li&gt;&lt;li&gt;(Error functionality): The second orchestration shows as started in the BizTalk Admin Console, it can be viewed in Orchestration Debugger, but it never starts processing even its first shape.  (The event log blurb will be at the end of the post, because it's a bit bloaty and will detract from the commentary).&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;So, in my usual troubleshooting-cum-why-is-it-always-me-to-sort-this-out kind of way, I then had to start looking at why this was happening.  The strange thing is that nothing much had changed on these orchestrations for about 2 months.  It was a stable and well-tested piece of functionality.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What had changed, however, was the structure of the entity that I was getting back.  An additional property had been added to the top-level entity that was itself a class containing 3 properties, two strings and a byte array.  Nothing controversial here, I thought. I checked out this new class to see if it was serializable (a common thing for non-BizTalk devs to miss off) and it was OK (in fact if it is not serializable then you get a compile rather than a runtime error). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then put a temporary hack into the data access code to set the new property to null, to see if the creation of this new object was causing the issue and instantly the orchestration started to work as normal.  I was starting to get somewhere.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you look at the error and examine the stack trace you see that there is an index out of bounds error on an array.  Now, you may recall that the new object has a byte array, so I thought that this must be the candidate.  I then looked at the values being passed through to the byte array and I found that although the byte array was being instantiated it had zero length.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the end the error was caused by BizTalk not being able to binary serialize / deserialize the state of the object into the orchestration.  This only happens if I have a zero-length array.  Just to prove it I put in the following line as a temporary measure:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;entity.MyProperty.MyByteArray = new byte[] { 0x00 };&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This went through the message box OK.   I then put in the following instead:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;entity.MyProperty.MyByteArray = null;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This also went through.  Therefore there is just an issue with a byte array of zero length.  I eventually settled on the following:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;if (entity.MyProperty.MyByteArray.Length == 0)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    entity.MyProperty.MyByteArray = null;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;In Summary&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This error was caused by an exception very low down in the BizTalk engine, and lay in the failure to serialize or deserialize the object into the orchestration state.  This was caused by the byte array being of zero length (which is legitimate from a .Net point of view), so this may be a fault oin the BizTalk engine.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a work around, setting the byte array to null when it is empty allowed the orchestration to function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Exception / Stack Trace&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Event Type:        Error&lt;/div&gt;&lt;div&gt;Event Source:    XLANG/s&lt;/div&gt;&lt;div&gt;Event Category:                None&lt;/div&gt;&lt;div&gt;Event ID:              10001&lt;/div&gt;&lt;div&gt;Date:                     06/10/2009&lt;/div&gt;&lt;div&gt;Time:                     10:14:17&lt;/div&gt;&lt;div&gt;User:                     N/A&lt;/div&gt;&lt;div&gt;Computer:          &lt;&lt;computer&gt;&gt;&lt;/div&gt;&lt;div&gt;Description:&lt;/div&gt;&lt;div&gt;Failed while delivering a message to a service instance. Message details follow.&lt;/div&gt;&lt;div&gt;Message ID: 24abb7a4-060d-480b-abdd-c22f70118c11&lt;/div&gt;&lt;div&gt;Service Instance ID: c58613fa-3716-48df-9fc9-edd76cae2f13&lt;/div&gt;&lt;div&gt;Service Type ID: afa69d35-1f0f-7665-4264-b4b78f9abfef&lt;/div&gt;&lt;div&gt;Subscription ID: d7676de9-1e27-4dba-ae5d-223e77c64b50&lt;/div&gt;&lt;div&gt;Body part name: &lt;/div&gt;&lt;div&gt;Service type: &lt;&lt;class&gt;&gt;, &lt;&lt;assembly&gt;&gt;, Version=&lt;&lt;assembly&gt;&gt;, Culture=neutral, PublicKeyToken=&lt;&lt;public&gt;&gt;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;Exception type: BTXMessageDeliveryException&lt;/div&gt;&lt;div&gt;The following is a stack trace that identifies the location where the exception occured&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid&amp;amp; instanceId, Guid&amp;amp; serviceId, IBTMessage currentMsg)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[] messages, Int32 firstIdx, Int32 count)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object objMsg)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.BizTalk.CrossProcess.AppDomainStubProxy.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object msgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp;amp; outArgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp;amp; outArgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.InternalCrossContextCallback(Context ctx, InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage msg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage&amp;amp; smuggledMrm)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Additional error information:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        Failed while delivering a message to a service instance. Message details follow.&lt;/div&gt;&lt;div&gt;Message ID: 24abb7a4-060d-480b-abdd-c22f70118c11&lt;/div&gt;&lt;div&gt;Service Instance ID: c58613fa-3716-48df-9fc9-edd76cae2f13&lt;/div&gt;&lt;div&gt;Service Type ID: afa69d35-1f0f-7665-4264-b4b78f9abfef&lt;/div&gt;&lt;div&gt;Subscription ID: d7676de9-1e27-4dba-ae5d-223e77c64b50&lt;/div&gt;&lt;div&gt;Body part name: &lt;/div&gt;&lt;div&gt;Service type: &lt;&lt;class&gt;&gt;, &lt;&lt;assembly&gt;&gt;, Version=&lt;&lt;assembly&gt;&gt;, Culture=neutral, PublicKeyToken=&lt;&lt;public&gt;&gt;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;Exception type: BTXMessageDeliveryException&lt;/div&gt;&lt;div&gt;Source: Microsoft.XLANGs.BizTalk.Engine&lt;/div&gt;&lt;div&gt;Target Site: Void DeliverMessage(System.Guid, Microsoft.BizTalk.Agent.Interop.IBTMessage, Boolean ByRef)&lt;/div&gt;&lt;div&gt;The following is a stack trace that identifies the location where the exception occured&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._tryReceiveOneMessage(Boolean&amp;amp; loggedError, Guid&amp;amp; instanceId, IBTMessage currMsg)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession._receiveOneMessage(Guid&amp;amp; instanceId, Guid&amp;amp; serviceId, IBTMessage currentMsg)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession.ReceiveMessages(IBTMessage[] messages, Int32 firstIdx, Int32 count)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.AppDomains.AppDomainRoot.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object objMsg)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.BizTalk.CrossProcess.AppDomainStubProxy.Microsoft.XLANGs.BizTalk.ProcessInterface.IAppDomainStub.ReceiveMessages(Object msgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp;amp; outArgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]&amp;amp; outArgs)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessageCallback(Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.InternalCrossContextCallback(Context ctx, IntPtr ctxID, Int32 appDomainID, InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.InternalCrossContextCallback(Context ctx, InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossContextChannel.SyncProcessMessage(IMessage reqMsg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage(IMessage msg)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage&amp;amp; smuggledMrm)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args)&lt;/div&gt;&lt;div&gt;   at System.Threading.Thread.CompleteCrossContextCallback(InternalCrossContextDelegate ftnToCall, Object[] args)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Additional error information:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        Index was outside the bounds of the array.&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;Exception type: IndexOutOfRangeException&lt;/div&gt;&lt;div&gt;Source: Microsoft.BizTalk.Pipeline&lt;/div&gt;&lt;div&gt;Target Site: Int32 Read(Byte[], Int32, Int32)&lt;/div&gt;&lt;div&gt;The following is a stack trace that identifies the location where the exception occured&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.Message.Interop.StreamViewOfIStream.Read(Byte[] buffer, Int32 offset, Int32 count)&lt;/div&gt;&lt;div&gt;   at System.IO.BinaryReader.ReadBytes(Int32 count)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArrayAsBytes(ParseRecord pr)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum binaryHeaderEnum)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)&lt;/div&gt;&lt;div&gt;   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.CustomFormattedPart.ProtectedUnpersist(Stream stm)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.CustomFormattedPart.Unpersist(UnderlyingPart ulPart)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.Part._slowProtectedRegisterWithValueTable()&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.Part.ProtectedRegisterWithValueTable()&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.Part.RetrieveAs(Type t)&lt;/div&gt;&lt;div&gt;   at Microsoft.XLANGs.Core.DotNetPart.get_Object()&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.ExecMessage.GetParam(Int32 i)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.ArgsFromExecEnvelope(IBTMessage msg)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.DeliverMessageImpl2(Guid subscriptionId, IBTMessage msg, Boolean&amp;amp; receiveCompleted)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.DeliverMessageImpl(Guid subscriptionId, IBTMessage msg, Boolean&amp;amp; receiveCompleted)&lt;/div&gt;&lt;div&gt;   at Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.DeliverMessage(Guid subscriptionId, IBTMessage msg, Boolean&amp;amp; receiveCompleted)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-2807819557775125811?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/2807819557775125811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=2807819557775125811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2807819557775125811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2807819557775125811'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/biztalk-error-failed-while-delivering.html' title='BizTalk Error: Failed while delivering a message to a service instance. Message details follow.'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-8241066423536393814</id><published>2009-10-03T12:13:00.006Z</published><updated>2009-10-03T13:50:20.283Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSIS'/><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='XSD'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>BizTalk Multi-Part Messages and Serialization</title><content type='html'>I've been back working on BizTalk lately so the next few posts are going to be about BizTalk issues that have arisen from some things that have come up lately.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This post is going to cover a defect that I had to resolve lately, and the insight into using BizTalk that comes from the cause / solution.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am currently working on a banking system that needs to reliably flow payment transactions to people's accounts.  The functionality of the system I was working on can be described as follows, without any danger of giving away anything commercially sensitive:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;The system batch-processes BACS payments onto a ledger. Once per day input files come from a mainframe system and the payments need to be loaded into the ledger.  &lt;/li&gt;&lt;li&gt;An SSIS process decodes the files into a staging database location.&lt;/li&gt;&lt;li&gt;The payments are extracted from the database for transmission to the ledger.  This is done using BizTalk.&lt;/li&gt;&lt;li&gt;The payments are split into batches and transmitted to the ledger.&lt;/li&gt;&lt;li&gt;The ledger responds asynchronously with a message that describes the success / failure of the payment transaction.&lt;/li&gt;&lt;li&gt;Payments that ultimately fail get written into a SQL table.&lt;/li&gt;&lt;li&gt;Once per day, when processing of the payments is complete, the failed payments are extracted into a BACS file using an SSIS process.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Now, given this, there was a bug raised which stated that the amount value for the payments that are in the failed payment output file were being written as zero.  Here is a description of the basic fault finding process:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;Bug was raised against the SSIS developer who wrote the output package.  He unit tested the extraction process and verified that the value was being written correctly.&lt;/li&gt;&lt;li&gt;The bug was then assigned to the  developer who wrote the data access layer that writes the failed payments into the output staging table.  He then verified that the amount values get written correctly into the database.  &lt;/li&gt;&lt;li&gt;The bug was then assigned to the BizTalk team and that meant that me, being one of the BizTalk architects with an overview of the entire process, was called in to look at the issue.&lt;/li&gt;&lt;li&gt;The first thing I did was to attach a debugger onto the BizTalk hosts, so that I could look at the actual values being passed through the system. First, I debugged the orchestration that writes out the failed payments.  I verified that the amount being written by BizTalk was zero - thus confirming that there was no issue with the data access code.&lt;/li&gt;&lt;li&gt;I then debugged the orchestration that receives the failed payments and verified that the payment amount was non-zero.  This meant that somewhere between receiving the payment and writing the payment out the value was being set to zero - but how?&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;The answer to this lay in the way that BizTalk handles messages.  Using good practice, my payment information was held in a multi-part message type (see previous post).  Because of the required throughput of the system and the need to access the payment object model, the payment data is held in BizTalk as a .Net object rather than an XML message.  Now, this is OK - I can assign a .Net class to a message part as well as an XML schema - &lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;as long as the classes are XML serializable&lt;/span&gt;.  This is because the multi-part message, when sent to the message box, gets XML serialized.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we're getting somewhere.  In the process I was looking at the payments are received (as mentioned) and then context information is promoted on the multi-message and it is written into the message box.  Different orchestrations then subscribe to the multi-part message by filtering on the context and performing payment-specific business processing.  Through further debugging I narrowed the fault down - before we write to the message the value is non-zero and after the message box, in the subscribing orchestration, the value is zero.  Baffling.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, the answer to this lay in the serialization, as you could probably guess from the title of this post.  The payments were originally defined using an XML schema and then the .Net classes were generated using XSD.exe.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;OK, so let's strip this back to the essence of the problem.  Let's say that I have a payment schema:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;xs:schema b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://Andrew.Blog.MultiPart.Schemas.Payment" targetnamespace="http://Andrew.Blog.MultiPart.Schemas.Payment" xs="http://www.w3.org/2001/XMLSchema"&gt;&lt;/xs:schema&gt;&lt;/div&gt;&lt;div&gt;  &lt;xs:element name="Payment"&gt;&lt;/xs:element&gt;&lt;/div&gt;&lt;div&gt;    &lt;xs:complextype&gt;&lt;/xs:complextype&gt;&lt;/div&gt;&lt;div&gt;      &lt;xs:sequence&gt;&lt;/xs:sequence&gt;&lt;/div&gt;&lt;div&gt;        &lt;xs:element minoccurs="0" name="PaymentValue" type="xs:decimal"&gt;&lt;/xs:element&gt;&lt;/div&gt;&lt;div&gt;      &lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And I then create a serializable class for this using XSD.exe:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;//------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;// &lt;auto-generated&gt;&lt;/auto-generated&gt;&lt;/div&gt;&lt;div&gt;//     This code was generated by a tool.&lt;/div&gt;&lt;div&gt;//     Runtime Version:2.0.50727.3074&lt;/div&gt;&lt;div&gt;//&lt;/div&gt;&lt;div&gt;//     Changes to this file may cause incorrect behavior and will be lost if&lt;/div&gt;&lt;div&gt;//     the code is regenerated.&lt;/div&gt;&lt;div&gt;// &lt;/div&gt;&lt;div&gt;//------------------------------------------------------------------------------&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;// &lt;/div&gt;&lt;div&gt;// This source code was auto-generated by xsd, Version=2.0.50727.3038.&lt;/div&gt;&lt;div&gt;// &lt;/div&gt;&lt;div&gt;namespace Andrew.Blog.MultiPart.Entities {&lt;/div&gt;&lt;div&gt;    using System.Xml.Serialization;&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    /// &lt;remarks&gt;&lt;/remarks&gt;&lt;/div&gt;&lt;div&gt;    [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")]&lt;/div&gt;&lt;div&gt;    [System.SerializableAttribute()]&lt;/div&gt;&lt;div&gt;    [System.Diagnostics.DebuggerStepThroughAttribute()]&lt;/div&gt;&lt;div&gt;    [System.ComponentModel.DesignerCategoryAttribute("code")]&lt;/div&gt;&lt;div&gt;    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true, Namespace="http://Andrew.Blog.MultiPart.Schemas.Payment")]&lt;/div&gt;&lt;div&gt;    [System.Xml.Serialization.XmlRootAttribute(Namespace="http://Andrew.Blog.MultiPart.Schemas.Payment", IsNullable=false)]&lt;/div&gt;&lt;div&gt;    public partial class Payment : object, System.ComponentModel.INotifyPropertyChanged {&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        private decimal paymentValueField;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        private bool paymentValueFieldSpecified;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        /// &lt;remarks&gt;&lt;/remarks&gt;&lt;/div&gt;&lt;div&gt;        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]&lt;/div&gt;&lt;div&gt;        public decimal PaymentValue {&lt;/div&gt;&lt;div&gt;            get {&lt;/div&gt;&lt;div&gt;                return this.paymentValueField;&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;            set {&lt;/div&gt;&lt;div&gt;                this.paymentValueField = value;&lt;/div&gt;&lt;div&gt;                this.RaisePropertyChanged("PaymentValue");&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        /// &lt;remarks&gt;&lt;/remarks&gt;&lt;/div&gt;&lt;div&gt;        [System.Xml.Serialization.XmlIgnoreAttribute()]&lt;/div&gt;&lt;div&gt;        public bool PaymentValueSpecified {&lt;/div&gt;&lt;div&gt;            get {&lt;/div&gt;&lt;div&gt;                return this.paymentValueFieldSpecified;&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;            set {&lt;/div&gt;&lt;div&gt;                this.paymentValueFieldSpecified = value;&lt;/div&gt;&lt;div&gt;                this.RaisePropertyChanged("PaymentValueSpecified");&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;        protected void RaisePropertyChanged(string propertyName) {&lt;/div&gt;&lt;div&gt;            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;&lt;/div&gt;&lt;div&gt;            if ((propertyChanged != null)) {&lt;/div&gt;&lt;div&gt;                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And you will see that the serialized entity not only has a field for the decimal, but it expects the "PaymentValueSpecified" property to be set to indicate that the decimal has a value.  This is because the field is marked as an optional field in the XML schema, to handle the cases where the field is nullable or unassigned.  Unfortunately, in the code the flag to indicate that the payment value was set had not been changed and was still false.  [It would be a good idea to set this field in the property set.]  Therefore, the XML serializer was still thinking that there was no value and hence the payment value element was not present in the XML when the object was serialized (as it is written to the message box).  When the message is deserialized the XML element for payment value is not present and so the decimal field defaults in value to zero.  Hence the bug.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;b&gt;In Summary&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;.Net objects can be used as part of multi-part message types; this improves the maintainability of your orchestrations and also allows context information to be written onto .Net objects.  &lt;/li&gt;&lt;li&gt;.Net objects, when assigned to a message part, are XML serialized when they are written to the message box.  For this purpose, they must be XML serializable.  It is easiest to generate these classes from an XML schema.&lt;/li&gt;&lt;li&gt;Be careful that your .Net object serializes as you expect, because if it doesn't you can get unexpected and unexplained issues in your solution.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I would point out that I inherited the schemas and entities here but somehow I was the one who had to sort out this issue.  as usual ;)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-8241066423536393814?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/8241066423536393814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=8241066423536393814' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8241066423536393814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8241066423536393814'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/10/biztalk-multi-part-messages-and.html' title='BizTalk Multi-Part Messages and Serialization'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-5865745075881457977</id><published>2009-09-27T19:52:00.003Z</published><updated>2009-09-27T19:56:54.358Z</updated><title type='text'>Handy BizTalk links</title><content type='html'>I haven't been blogging much lately because I have had a couple of back-to-back customer engagements that have involved a lot of travel and work hours and the last thing on my mind at the end of it has been to get my laptop out again!  However, I have been working on some seriously large stuff and have come across lots of interesting things to blog about.  I should soon be starting to detail some of these.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, to get started, I have been working with Benjy (&lt;a href="http://santoshbenjamin.wordpress.com/"&gt;http://santoshbenjamin.wordpress.com/&lt;/a&gt;) lately and he sent me a link to a useful article so I thought I'd post it here.  The reason I'm posting it is that one of the items that is detailed in here, multi-part message types in BizTalk, is going to be the subject of my next post.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The article is here &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163423.aspx"&gt;http://msdn.microsoft.com/en-us/magazine/cc163423.aspx&lt;/a&gt;  Enjoy. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-5865745075881457977?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/5865745075881457977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=5865745075881457977' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5865745075881457977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5865745075881457977'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/09/handy-biztalk-links.html' title='Handy BizTalk links'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-7278550130973064520</id><published>2009-07-07T14:28:00.005Z</published><updated>2009-07-08T11:25:26.830Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>SQL Deployment Strategies</title><content type='html'>Most line of business applications now maintain their state in a database.  Well, most of the ones I have been involved with do anyway.  I have recently been parachited onto the fag end of a project to sort out....well you guessed it - database deployment.  And guess what - after I got involved and did my stuff we got it right.  Almost.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's quite easy to deploy a database from scratch.  What always gets in the way is to upgrade databases, especially when you have an application of many different versions and where the data is in different states as well.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a result of this I have been prompted to write a bit about database deployment strategies and to give some thoughts about what I believe is the way forward.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Clean / first-time deployment&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first time you deploy an application you can go for the "clean deployment" strategy.  All you need to do is to create a SQL script (or scripts) that deploy your database and you're in business. A useful tool for this may be the SQL Publishing Wizard (&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=56E5B1C5-BF17-42E0-A410-371A838E570A&amp;amp;displaylang=en&lt;/a&gt;) which will script off your entire database so you can deploy it elsewhere.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the more difficult aspects of SQL deployment comes where the deployment will chenge depending on the target environment.  A prime example of this is where you need to deploy tour .MDF and .LDF files into specific locations (e.g where your database server has SAN-attached storage) and so your create database script needs to specify this.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another complication of environment-specific database installation is permissions and logins.  Each environment will potentially have different logins.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The way that I usually get around this is as follows:  I don't usually script off my database as one huge script.  I usually break it down into sections (CreateDatabase.sql, CreateLogins.sql etc) and have a batch file run these scripts in order.  I then use InstallShield to deploy the scripts onto the target server and I run the batch file as a custom action.  Easy you might think.  However, before the batch file runs I need to modify the create database script with the file locations and I need to modify the permissions script with the actual logins.  This is soemthing again that InstallShield can do, or you can also perform some other sort of environment-specific replacement on your scripts before you deploy them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Upgrading a database&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;i&gt;Strategy #1 - Create a set of "delta" scripts&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using this strategy, you have an install for v1.0 (say).  When time comes to make version 2.0 you create a script that assumes that your database is in the 1.0 state and then applies the changes.  This may involve adding tables, adding columns to tables and adding data.  You can even create a first step in your script that will raise an error if your database is not at the correct version.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;Hint:  Create a table in your database that includes the database version number.  Your upgrade scripts can then update this value on each deployment, and it's a handy way of making sure that you don't run scripts incorrectly and a means of having a confidence check in your deployment.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The advantages of this method is that everything is above board.  If you are installing an application v3.0, and your database is at 1.0, you need to install database v2.0 and then database v3.0 and you're in business.  The downside of this is that if your database structure is out of kilter then everything breaks irretrievebly - but then again is that such a bad thing?  Another downside is that you never get a "complete" view of your database objects as the scripts to create then become fragmented across many sql scripts as you progress through versions.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;i&gt;Strategy #2 - use a SQL differencing tool!&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a simpler strategy to implement if you have already got the scripts to create your database from scratch.  What you do here is firstly maintain a "reference" installation of each of the databases you have in your live environment.  You then create your new database installation by maintaining your database build scripts.  When it comes to release, you use some sort of SQL Comparison tool to detect the differences between the database installations and generate a script to upgrade from one to the other.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;An advantage of this approach is that your developers only work with scripts to create the new database standard (from scratch) and the upgrade process becomes an issue of release management, which may be controlled in a different way.  Also, if you need to support customers who have different database structures that were in service before you got control of the deployment process you can just take a reference version of their database and create a script for them.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The downside of this approach is that it often requires use of desktop tools and so it often does not lend itself to automatic build processes, so there is a human fators element in there and not a process automation.  From a quality perspective, this is to be avoided.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;Strategy #3 - use re-runnable scripts&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the features of a database is that it is really only the tables that have to be retained when you upgrade a database.  This means from the point of view of the deployment you can drop / recreate most of your database objects from views, stored procedures, indexes etc.  The scripts might look something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[usp_HelloWorld]') AND type in (N'P', N'PC'))&lt;/div&gt;&lt;div&gt;DROP PROCEDURE [dbo].[usp_HelloWorld]&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;SET ANSI_NULLS ON&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;SET QUOTED_IDENTIFIER ON&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;-- =============================================&lt;/div&gt;&lt;div&gt;-- Author:&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;Andrew&lt;/div&gt;&lt;div&gt;-- Create date: 7/7/2009&lt;/div&gt;&lt;div&gt;-- Description:&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Hello World&lt;/div&gt;&lt;div&gt;-- =============================================&lt;/div&gt;&lt;div&gt;CREATE PROCEDURE usp_HelloWorld&lt;/div&gt;&lt;div&gt;AS&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;-- SET NOCOUNT ON added to prevent extra result sets from&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;-- interfering with SELECT statements.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SET NOCOUNT ON;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    -- Insert statements for procedure here&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SELECT 'Hello World!' AS HelloWorld&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The other thing with tables is that of course you can check to see if they are there, so your script for a table might look similar, but just wouldn't have the DROP statement at the top:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MyTable]') AND type in (N'U'))&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;CREATE TABLE [dbo].[MyTable](&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[ID] [uniqueidentifier] NOT NULL,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[SomeText] [nvarchar](50) NOT NULL,&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;(&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;[ID] ASC&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;) ON [PRIMARY];&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PRINT 'Table MyTable added.'&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;ELSE&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PRINT 'Table MyTable already exists.'&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The other issue is where we upgrade tables by adding columns to them.  The way that I would do this in my projects would be to have a script for each table, and the create table script will always create the table at the latest version.  The for each upgrade I will add something like this in the same script but underneath the CREATE statement:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;IF NOT EXISTS (SELECT * FROM syscolumns WHERE [name] = 'AnotherColumn' AND id = (SELECT id FROM sysobjects WHERE [name] = N'MyTable'))&lt;/div&gt;&lt;div&gt;BEGIN&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ALTER TABLE dbo.MyTable ADD&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;AnotherColumn int NULL&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PRINT 'Column AnotherColumn on table MyTable added.'&lt;/div&gt;&lt;div&gt;END&lt;/div&gt;&lt;div&gt;ELSE&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;PRINT 'Column AnotherColumn on table MyTable already exists.'&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using this strategy, you can create a set of database installation scripts that can be run and re-run any number of times, and by runing the scripts you will upgrade the database to the latest version whether by install or upgrade.  In my opinion, this is the safest way to write scripts for your database as you run the same set of scripts on all databases and can re-run them any number of times.  It makes the process of patching easier as again you just need to run the full set of scripts.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Summary Thoughts&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As I said at the start, we've been doing this for years and yet time and again I see projects where this isn't going right.  I think it is key for a project to decide on a database deployment and upgrade strategy and to stick with it.  It won't go right if you leave it to chance and hope.  Make sure the developers in your project team know what the strategy is and when creatign scripts make sure that all scripts run OK.  Test deployment and upgrades thoroughly.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy scripting!&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-7278550130973064520?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/7278550130973064520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=7278550130973064520' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/7278550130973064520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/7278550130973064520'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/07/sql-deployment-strategies.html' title='SQL Deployment Strategies'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-2213806395756622998</id><published>2009-06-19T08:39:00.007Z</published><updated>2009-06-19T11:50:09.636Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Merging'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='Branching'/><category scheme='http://www.blogger.com/atom/ns#' term='source control'/><title type='text'>Team Foundation Server:  Some thoughts on source control branching strategies</title><content type='html'>&lt;div&gt;I thought I'd just write a short note on some of the source control branching strategies employed and how these relate to how I might use my preferred source control repository, Team Foundation Server (TFS).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;I have been working with a customer who are using the IBM Rational toolset for just about everything and I have been ranting about how bad it is and how great TFS is, but one of the things that has given me cause to think is the way that the customer uses the ClearCase source control for branching and merging.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This has echoes with another customer I worked with last year (&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;very&lt;/span&gt; large UK bank) that was using Harvest - now a CA product - for their source control.  This was also working in a similar way and I was considering how this contrasted with the way that we usually use TFS.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Streaming Source Control Model&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first thing that I would say is that TFS is tuned for developer productivity whereas IBM Rational ClearCase is tuned for control.  This in itself makes for some interesting differences, which I may expound on in a later blog post.  The next immediate observation is that they handle changesets differently.  This is because Harvest and ClearCase use a hierarchial branching structure.  Typically, you might have a series of environments that your code is going to progress through, and you might have different builds of code at each of these stages.  You therefore create a branch that represents each of these stages and order them in a hierarchy.  At the top of the stack you have your current production code, then you might have QA, then maybe System Integration, then Continuous Integration and at the bottom of the stack you have a branch where you are actually developing.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The way that the Harvest and ClearCase work is that you create packages of changes that essentially ought to relate to features, which may actually contain multiple check-ins of code.  When the feature is deemed to be complete in development it is "promoted" to the next level (i.e. CI), built and tested.  You might vary the next bit depending on your project methodology, but essentially you take periodic releases of the software.  This is then usually done by promoting the tested backages from your CI environment and progressing them through the remaining branches until they become the production release.  If bugs occur through the environment fixes can be applied at any of the other levels and added to the build.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the sticking points here is that you can only check in changes against a single feature at one time, and so this makes concurrent development more difficult - and this is especially difficult when it comes to a bug-fixing stage of a project iteration when lots of small changes are being made with high frequency.  (I know we should only be promoting bug-free code, but get in the real world).  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In Team Foundation Server source control it is possible to set up a similar branching strategy and use the merging features as a means of promotion.  You can still make all of the associated levels but there is no direct hierarchy implicit in the system.  This is enforced by usage and also that merges can only be made up and down the lines of the branches.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the major contrasts lies with TFS where changesets.  These can be / are associated with one or more work items, but they have a much looser correlation, and the changeset is the atomic unit of change rather than the feature.  Therefore if you want to promote a feature you have to merge in all of the changesets up to the last changeset for that feature.  This will also usually mean merging in all of the changesets that relate to other features as well, meaning that code on "unfinished" features may get promoted as well.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This might appear to mean that TFS has got much less control (and there is some merit in that observation) but it also means that you have a more consistent behaviour when you merge.  In the feature-based model of ClearCase it is possible that some dependent code, not changed in a feature being promoted but changed in another non-promoted feature, will change the overall behaviour of the solution.  If you promote all changesets up to a given point then at least you know that your build will behave the same.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Release-Based Source Control Model&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the implicit assumptions of the streaming approach is that you have a separate build in each stream and that the sourec code of the stream constitutes the "release" in many ways.  An alternative model that is often used in TFS is to branch based on releases.  Let's imagine you are shipping a software product Widget 2009.  You also have to support Widget 2008, Widget 2007 and Widget 2006, all of which are based on the same source code but with enhancements and developments in the intervening period.  You have to support all of these products and be able to issue service packs against them.  You also need to make sure that if you bug fix Widget 2006 that same fix can be merged into the later releases as well.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this scenario the hierarchical streaming model is not suitable, because each time you promote a new set of features to your production stream and start building a new "production" release of your software you are effectively ending the ability to build your previous versions.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What you might do in this model is to have a branch for each release of your software again with a build process for each branch, but each branch does not overwrite the others and has its own lifecycle.  If you need to patch a previous release into "production" you don't have to overwrite the other production release.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;When to use each approach&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have discussed a couple of different approaches to branching and maintaining releases, both of which are in use in various organisations and each has its merits and demerits.  The question is - if you have to put in place a branching strategy which one qould you choose?  Which one is most appropriate in different circumstances?  What are the pros / cons of this approach?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What I would say with this is that if you are shipping software product where you need to be able to manage the source on many versions of the software at the same time then you will need the second approach, and have a branch for each release.  This scenario involves many different users who use different releases from each other and therefore all need to be supported.  Desktop applications definitely fall into this category, as do many other retail packaged software products such as components and server products.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The release-based approach does have its side-effects and these should not be ignored.  The main side-effect is that if you have many releases of your software you end up with a large number of branches and build profiles and these become difficult to manage.  As I said, an annual release of a software product isn't going to lead to unacceptable overhead in this model.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, another very common scenario is where an organisation has a software product that needs to be refreshed on a periodic basis.  When the upgrade happens all users are affected at the same time and cannot choose whether they participate in the product or not - they are sent the upgrade anyway.  This is most commonly applied to software teams within an company producing bespoke software, but may also be applied to self-updating applications such as iTunes where upgrades are pushed out regularly and downloaded over the Internet and installed.  It also applies to .com organisations where you obviously have one current production build of your software.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In these scenarios you tend to have a high number of releases, especially with agile projects, and once a release has made it to production you discard the previous releases as you will never be opening up and servicing the old code.  In this scenario it is easier to manage your source code if you have a limited number of streams and promote changes up through them, irrespective of whether you are prmoting changesets in TFS or features in Harvest or ClearCase.  Once you have got all of your branches building you may find you have a lower project overhead in maintaining your builds.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;In conclusion.....&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A modern source control repository must support effective branching and merging in order to handle development of new versions of software whilst supporting current versions.  The manner in which you branch will depend on your release cycle and the type of software that you produce.  Picking the correct branching strategy for your project will have a direct impact on how effectively you can support your software, so take time to think about it and get it right.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-2213806395756622998?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/2213806395756622998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=2213806395756622998' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2213806395756622998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2213806395756622998'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/06/team-foundation-server-some-thoughts-on.html' title='Team Foundation Server:  Some thoughts on source control branching strategies'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-74072771266374808</id><published>2009-06-09T10:10:00.009Z</published><updated>2009-06-15T21:06:00.936Z</updated><title type='text'>Enable Unit Testing in BizTalk 2009</title><content type='html'>&lt;div&gt;BizTalk 2009 has, for the first time, built-in developer support for testing schemas, maps and pipelines that is available for automated unit testing rather than being hidden behind features in Visual Studio where it can only be used for manual testing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Anyone interested in finding out more about BizTalk unit testing wouldn't go far wrong looking at Michael Stephenson's series on unit testing &lt;a href="http://geekswithblogs.net/michaelstephenson/archive/2008/12/12/127828.aspx"&gt;http://geekswithblogs.net/michaelstephenson/archive/2008/12/12/127828.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;To use or not to use (the unit testing framework)&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;There has been a debate around the office lately regarding the unit testing features in BizTalk 2009.  The debate goes something like this:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.  You don't want to have unit testing enabled on your production assemblies.&lt;/div&gt;&lt;div&gt;2.  If you enable unit testing on your assemblies for test and then switch it off for release then you are releasing different (although generated) code.&lt;/div&gt;&lt;div&gt;3.  Is the unit testing framework any good anyway?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There has seemed to be a consensus that the unit testing features in BizTalk 2009 aren't that good and we should do without them.  However, I beg to differ!  Premise #1 - that unit testing should not be enabled on production releases - is I think a false premise.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For example, let's look at unit testing of schemas in more detail.  When you enable unit testing you actually change the base class from which your schemas derive, but this base class in turn inherits from the SchemaBase class anyway.  All that is added is a method called ValidateInstance which you hook into for your tests - all the rest of the implementation is the same, so to me there is no issue with using this in production code.  It means that you can build in release mode and then run your unit tests against your production assemblies to examine their quality which surely should be a good thing! &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Remember to set the configurations&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you set your deployment properties on your BizTalk project, you are probably developing in Debug mode, and you might not think to change the deployment settings for release.  If you don't explicitly enable unit testing for all configurations or specifically for release then by default your release assemblies will be built without unit testing enabled.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is something that happened to us today.  We are in the first iteration of a project, we've successfully put in a build process right at the start, that build process packages the code into an InstallShield package and installs it onto a Consuinuous Integration environment.  We were just getting the build to run the unit and integration tests and publish the results back to examine the build quality and we started getting an error like this when building the test projects:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Cannot implicitly convert type 'XXXX.YYYY.Transforms.CustomerAccount_to_CustomerDetails' to 'Microsoft.BizTalk.TestTools.Mapper.TestableMapBase'&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My first reaction was to check that the references in the unit test project were correct - which they were.  I had copied the Microsoft.BizTalk.TestTools.dll assembly into a referenced assemblies folder.  That was all OK.  I then checked to see whether the referenced assembly was available on the build server.  It was.  In the end the issue was that we were building in Release mode and I had only enabled unit testing in Debug mode.  Because of this, my schemas were inheriting from SchemaBase and not TestableSchemaBase and my maps from MapBase and not TestableMapBase etc.  Whilst the schemas and maps projects all built OK the build error appeared in the test project.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As soon as I enabled unit testing for all build configurations the schemas then everything built OK and I could go ahead and build my tests.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Test tools not available&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This then led quickly onto another issue.  The build process always builds in release mode, but it had been set so that unit testing was not enabled.  Then when I enabled unit testing the build was OK, and all of the unit tests were passing but we're doing continuous integration so the build process, after the unit tests, includes a deployment step and then a second set of integration tests on the deployed system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately, once the build was making the assemblies testable the deployment script failed (we use InstallShield to put the DLLs onto the file system and then use BTSTask to deploy them into BizTalk as a custom action).  BTSTask was failing to deploy the new build because the reference to Microsoft.BizTalk.TestTools could not be resolved.  I checked my development machine - it has BTS2009 Developer Edition and Microsoft.BizTalk.TestTools was in the Global Assembly Cache.  I then checked the build server, also using developer edition, Microsoft.BizTalk.TestTools was in the GAC on there.  I then checked the integration server where we are automatically deploying to - Microsoft.BizTalk.TestTools was missing from the GAC as the developer tools were not installed.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I had to modify the build so that the build tools were deployed into the GAC and then the assemblies would build OK.  This goes right back to point #1 above:  if the core BizTalk 2009 install does not include the test tools should we be putting them on there anyway or using a different method of unit testing that does not rely on the test tools?  On the other hand, if the test tools are there out-of-the-box, shoudn't we be using them?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The debate rumbles on.......&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-74072771266374808?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/74072771266374808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=74072771266374808' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/74072771266374808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/74072771266374808'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/06/enable-unit-testing-in-biztalk-2009.html' title='Enable Unit Testing in BizTalk 2009'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-1207955838904691924</id><published>2009-06-03T20:44:00.007Z</published><updated>2009-06-08T22:07:07.722Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Event Log'/><title type='text'>Some funnies with creating and writing to event logs</title><content type='html'>Today I was working with my project team on tracing and diagnostics, and we made a decision to move all of our event sources into a new application log.  So, I changed my installer to create a new application log, removed my old application sources and registered my new application sources.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then made sure that the BizUnit tests were changed to look for the event log entries in the correct event log and ran the regression suite and guess what - they all failed!  I looked for the events and found that my new event log was there but pitifully empty and instead the events were still being written into the Application log.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then checked my registry keys in HKLM/SYSTEM/CurrentControlSet/Services/EventLog and they were all OK as well, all pointing to the correct event log.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I was also wondering if this was a Windows 2008 thing, because the event log infrastructure has changed quite a bit in there as well.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I did a bit of rooting around, and found some good thoughts out there, including a forums post here &lt;a href="http://www.eggheadcafe.com/community/aspnet/2/10022041/writing-to-custom-event-l.aspx"&gt;http://www.eggheadcafe.com/community/aspnet/2/10022041/writing-to-custom-event-l.aspx&lt;/a&gt; which is one place that points to some support info from Microsoft &lt;a href="http://support.microsoft.com/default.aspx/kb/815314"&gt;http://support.microsoft.com/default.aspx/kb/815314&lt;/a&gt; and that didn't really take me anywhere because I was doing what seemed to be the right thing already.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the end it was much more mundane.  If you have removed an event source and registered it onto a different event log you need to reboot.  When the machine comes back up again all the events go into the right place. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-1207955838904691924?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/1207955838904691924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=1207955838904691924' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1207955838904691924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1207955838904691924'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/06/some-funnies-with-creating-and-writing.html' title='Some funnies with creating and writing to event logs'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-5599404240838795448</id><published>2009-06-02T15:29:00.010Z</published><updated>2009-06-03T20:30:12.977Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='BizTalk'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>Gotcha with the BizTalk Pipeline Component Wizard</title><content type='html'>When I was in the BizTalk equivalent of "short trousers" I put lots of my integration functionality inside orchestrations (as the training courses suggest).  As I got further under the bonnet, especially when performance was critical or, more recently, when considering asynchronous ESB patterns, I have tried to put more functionality into the messaging infrastructure when designing my BizTalk architectures.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The key to unlocking the messaging engine is pipelines, where you can manipulate messages and message context without having to fire up the orchestration engine.  However, when I first started to write my own pipeline components I mainly based them on the SDK.  This was OK, but there was a lot of cut&amp;amp;paste in there.  it was a blessing to get hold of the BizTalk Pipeline Component Wizard from Codeplex (&lt;a href="http://www.codeplex.com/btsplcw"&gt;http://www.codeplex.com/btsplcw&lt;/a&gt;) to use it as a software factory for creating pipeline components.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So there I was, merrily making pipeline components with the pipeline component wizard and all seemed OK.  I created a new project with the wizard when I got this....&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I created a solution and then created some solution folders to help organise things, and then I right-clicked on a solution folder and chose the project template for PLCW:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TRDeiMVJzrs/SibaSy5Yr3I/AAAAAAAAABY/AgHqVAScnZo/s1600-h/PLCW1.png"&gt;&lt;img src="http://4.bp.blogspot.com/_TRDeiMVJzrs/SibaSy5Yr3I/AAAAAAAAABY/AgHqVAScnZo/s400/PLCW1.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343198024356638578" style="cursor: pointer; width: 400px; height: 258px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And then putting in some options &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TRDeiMVJzrs/SibawWn3AgI/AAAAAAAAABg/NCF9QNOdQ-w/s1600-h/PLCW2.png"&gt;&lt;img src="http://1.bp.blogspot.com/_TRDeiMVJzrs/SibawWn3AgI/AAAAAAAAABg/NCF9QNOdQ-w/s400/PLCW2.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343198532163011074" style="cursor: pointer; width: 400px; height: 306px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TRDeiMVJzrs/Siba_iIpnSI/AAAAAAAAABo/y95MXDyJIlU/s1600-h/PLCW3.png"&gt;&lt;img src="http://4.bp.blogspot.com/_TRDeiMVJzrs/Siba_iIpnSI/AAAAAAAAABo/y95MXDyJIlU/s400/PLCW3.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343198792951373090" style="cursor: pointer; width: 400px; height: 306px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TRDeiMVJzrs/SibbLa-zPOI/AAAAAAAAABw/9VpZPnLXu7Y/s1600-h/PLCW4.png"&gt;&lt;img src="http://1.bp.blogspot.com/_TRDeiMVJzrs/SibbLa-zPOI/AAAAAAAAABw/9VpZPnLXu7Y/s400/PLCW4.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343198997189442786" style="cursor: pointer; width: 400px; height: 306px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/SibbXYvJtNI/AAAAAAAAAB4/8gS5t0sEe3I/s1600-h/PLCW5.png"&gt;&lt;img src="http://3.bp.blogspot.com/_TRDeiMVJzrs/SibbXYvJtNI/AAAAAAAAAB4/8gS5t0sEe3I/s400/PLCW5.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343199202745365714" style="cursor: pointer; width: 400px; height: 306px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, after this I hit the finish button and:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/Sibb1lwMRaI/AAAAAAAAACA/EIh0ov_tG7A/s1600-h/PLCW6.png"&gt;&lt;img src="http://3.bp.blogspot.com/_TRDeiMVJzrs/Sibb1lwMRaI/AAAAAAAAACA/EIh0ov_tG7A/s400/PLCW6.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5343199721635464610" style="cursor: pointer; width: 400px; height: 259px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The actual text is as follows:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;System.ArgumentException: Value does not fall within the expected range.&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;   at EnvDTE.Projects.Item(Object index)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;   at MartijnHoogendoorn.BizTalk.Wizards.PipeLineComponentWizard.BizTalkPipeLineWizard.CreateProject(Solution mySolution)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;   at MartijnHoogendoorn.BizTalk.Wizards.PipeLineComponentWizard.BizTalkPipeLineWizard.CreateSolution(_DTE IDEObject, Object[] ContextParams)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;   at MartijnHoogendoorn.BizTalk.Wizards.PipeLineComponentWizard.BizTalkPipeLineWizard.Execute(Object Application, Int32 hwndOwner, Object[]&amp;amp; ContextParams, Object[]&amp;amp; CustomParams, wizardResult&amp;amp; retval)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is a fully repeatable issue, and here is to work around this, right-click on the solution itself and then add the project to the solution directly.  If you do this it works like a dream.  Once the project has been created you can then move it under the correct solution folder.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am assuming that if you have read this the chances are that you have done a search on Google when you've run into this issue, so there's your answer.  Happy pipelining!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-5599404240838795448?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/5599404240838795448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=5599404240838795448' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5599404240838795448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5599404240838795448'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/06/gotcha-with-biztalk-pipeline-component.html' title='Gotcha with the BizTalk Pipeline Component Wizard'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_TRDeiMVJzrs/SibaSy5Yr3I/AAAAAAAAABY/AgHqVAScnZo/s72-c/PLCW1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-3705016108381450721</id><published>2009-06-01T20:32:00.002Z</published><updated>2009-06-01T21:40:34.079Z</updated><title type='text'>Some funnies with BizTalk property schemas</title><content type='html'>I haven't blogged for a couple of weeks, and I have been doing loads of interesting stuff recently, but so little time to blog about it.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, just as a little nugget, I have been creating an ESB solution using BizTalk (mainly messaging) and I have created a property schema that I want to use for my routing in my ESB.  Because I wanted to share my property schema I put it into a separate assembly.  Let's say it's default namespace and assembly name is of this form:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;MyCompany.MyApplication.Integration.Schemas.Routing&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's say that I have a single property in the property schema (out of pure laziness because I'm replaying this in a sample app) - and called it Property1.  I signed built and then built the assembly.  So far so good. If I want to use the property it will be MyCompany.MyApplication.Integration.Schemas.Routing.Property1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then created another schema assembly and started to add schemas to it.  Again, let's say that the default namespace of the assembly is in this form:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;MyCompany.MyApplication.Integration.Schemas&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I added a schema to the file with a couple of fields under the root element.  I signed and built it.  So far so good.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then referenced my property schema assembly and promoted some fields by referencing the property schema from the referenced assembly.  Again, so far so good, it all builds.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I then decided that I wanted the namespace of the property so that it is shorter (as it is to be shared).  Let's say that I want it to be MyApplication.Property1.  In order to achieve this Iclick on the property schema file, view the properties and then change the namespace to MyApplication.  I then try to build the project and - BANG - I get the following error:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Error&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;1&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;The type or namespace name 'Routing' does not exist in the namespace 'MyCompany.MyApplication.Integration.Schemas' (are you missing an assembly reference?)&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;C:\_projects\Solutions\Integration.Schemas.Routing\Integration.Schemas\Schema1.xsd.cs&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;43&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;68&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Integration.Schemas&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This may not be too unexpected because I didn't change the reference of the property schema in my schema, so I thought I'd remove the reference for the property schema and re-add it.  When I add the property schema everything seems to be OK, but I still get the same error!  Even though the property schema builds OK and the property schema can be added to the schema OK, but when it builds it fails.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ho-ho I thought.  What's going on here?  I then tried changing the default namespace in the assembly to be the same as the namespace for my file.  Same error.  I then tried changing the default and file namespaces to be something completely different (Badgers) and then it builds!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;After some chasing up, it appears that there is a known issue with BizTalk references that means you can't include part of a namespace inside a reference because it can't resolve the namespace.  You either have to keep the original namespace which is fully qualified from the root namespace as per your naming conventions, or you have to choose something that will not clash at all.  You can't abbreviate with just part of the namespace.  That's just the way it is.  If you're reading this and it's saved you from tearing out some of your hair then let me know :)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-3705016108381450721?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/3705016108381450721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=3705016108381450721' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/3705016108381450721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/3705016108381450721'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/06/some-funnies-with-biztalk-property.html' title='Some funnies with BizTalk property schemas'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-2544910211512503182</id><published>2009-05-15T07:40:00.002Z</published><updated>2009-05-15T07:46:44.471Z</updated><title type='text'>BizTalk Pipeline Component Wizard</title><content type='html'>I have been really busy lately!  Not that it's much interest to the general internet public out there but I am getting up to speed on a new ESB project on BizTalk 2009 and I haven't had much time to author any posts.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;My new project, being a service-bus design that makes maximum use of messaging and minimum use of orchestration, requires me to design a lot of custom pipelines and pipeline components.  I have noticed that on Codeplex there is a new version of the pipeline component wizard that is updated for BizTalk 2009 (presumably this is just the versions of the referenced assemblies as the interfaces look pretty much the same).  You can find it here:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://btsplcw.codeplex.com/"&gt;http://btsplcw.codeplex.com/&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you're interested in BizTalk but have not created your own pipelines yet, then please do go through the SDK to see how they're built.  There is a huge amount of power in there that is just waiting to be unleashed!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, because the messaging features of BizTalk (i.e. send + reveive ports) use the application bindings to link the components together they are far more flexible for installing updated versions than orchestrations, which have subscriptions that need to be managed in an upgrade scenario.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Happy Pipelining!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-2544910211512503182?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/2544910211512503182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=2544910211512503182' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2544910211512503182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/2544910211512503182'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/05/biztalk-pipeline-component-wizard.html' title='BizTalk Pipeline Component Wizard'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-461640635281102007</id><published>2009-05-06T15:50:00.006Z</published><updated>2009-05-06T17:07:37.003Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Problems with recursion in WCF serialization (hierarchical structures)</title><content type='html'>I know the title isn't too hot, but I wanted to write a post about a problem I've encountered lately with WCF serialization in hierarchical structures.  These come up a lot in the real world, and in the normal world of .Net, when relationships between classes are object references, there is no problem.  However, when you serialize these objects into XML using the WCF data contract serializer you find that the object references are replaced by child XML nodes.  When your references are circular you get into an in infinite loop.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let me explain by example.  Imagine that we have a database table containing a list of employees.  It might look something like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_TRDeiMVJzrs/SgGyx7UmXvI/AAAAAAAAABI/Af8iAAtsBso/s1600-h/EmployeeDatabaseTable.png"&gt;&lt;img src="http://1.bp.blogspot.com/_TRDeiMVJzrs/SgGyx7UmXvI/AAAAAAAAABI/Af8iAAtsBso/s400/EmployeeDatabaseTable.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5332740004590804722" style="cursor: pointer; width: 366px; height: 256px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;This encapsulates a simple hierarchy.  An employee can have a line manager and so the table is keyed back onto itself to form the hierarchy.  The data might be this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_TRDeiMVJzrs/SgGzIa_yQeI/AAAAAAAAABQ/aLVbEQMVD-A/s1600-h/EmployeeData.png"&gt;&lt;img src="http://3.bp.blogspot.com/_TRDeiMVJzrs/SgGzIa_yQeI/AAAAAAAAABQ/aLVbEQMVD-A/s400/EmployeeData.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5332740391050559970" style="cursor: pointer; width: 400px; height: 122px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As you can see, you have 3 records.  One manager and two direct reports.  If we were to represent this in classes we might have the following (note that I have implemented them as data contracts):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;    [DataContract(Namespace="http://andrew.com/employee")]&lt;/div&gt;&lt;div&gt;    public class Employee&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        [DataMember(Order = 0)]&lt;/div&gt;&lt;div&gt;        public string Name { get; set; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        [DataMember(Order = 1)]&lt;/div&gt;&lt;div&gt;        public string JobTitle { get; set; }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        [DataMember(Order = 2)]&lt;/div&gt;&lt;div&gt;        public Employee LineManager {get; set;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        [DataMember(Order = 3)]&lt;/div&gt;&lt;div&gt;        public EmployeeCollection DirectReports { get; set; }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    [CollectionDataContract(Namespace="http://andrew.com/employee")]&lt;/div&gt;&lt;div&gt;    public class EmployeeCollection : List&lt;employee&gt; {}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, we can see that for an employee we have a collection of their direct reports, and for each employee we can create a reference back to their line manager.  So, what I will do now is use a quick bit of LINQ-to-SQL to retrieve the employees from the database and an extension method to perform the conversion into the data contracts.  My code, if I were to create a simple service, might like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;namespace EmployeeService&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;    public class EmployeeServiceInstance : IEmployeeService&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        #region IEmployeeService Members&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        public Employee GetEmployeeByName(string name)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            using (DataAccess.EmployeesDataContext ctx = new DataAccess.EmployeesDataContext())&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;                var q = from a in ctx.Employees&lt;/div&gt;&lt;div&gt;                        where a.Name == name&lt;/div&gt;&lt;div&gt;                        select a.Translate();&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;                return (Employee)q.SingleOrDefault();&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;        #endregion&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    public static class Translator&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;        public static Employee Translate(this DataAccess.Employee entity)&lt;/div&gt;&lt;div&gt;        {&lt;/div&gt;&lt;div&gt;            Employee employee = new Employee()&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;                Name = entity.Name,&lt;/div&gt;&lt;div&gt;                JobTitle = entity.JobTitle,&lt;/div&gt;&lt;div&gt;                DirectReports = new EmployeeCollection()&lt;/div&gt;&lt;div&gt;            };&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            foreach (DataAccess.Employee e in entity.Employees)&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;                employee.DirectReports.Add(e.Translate());&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            //This is where you get the problem, by adding the reference back to the parent entity&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            employee.DirectReports.ForEach(p =&gt; p.LineManager = employee);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            return employee;&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0);"&gt;[Disclaimer:  This code is for illustration only.  My production code and production designs would not look like this!]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, what happens when we run this and search for "Bob" using the service?  We get the following error:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Test method EmployeeService.Tests.UnitTest1.TestMethod1 threw exception:  System.ServiceModel.CommunicationException: The underlying connection was closed: The connection was closed unexpectedly. ---&gt;  System.Net.WebException: The underlying connection was closed: The connection was closed unexpectedly..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you look this error up on the net it will tell you that it has occurred when the WCF message size limits have been breached.  This usually happens when you need to bring back lots of rows or when you are handling binary data.  In reality, in this case the error has occurred because the data contract serializer is stuck in an infinite loop passing backwards and forwards between the line manager and then employee records.  Because it is serializing as XML it loses the object references!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So all we have to do is comment out the line where we add the parent reference in...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;            //employee.DirectReports.ForEach(p =&gt; p.LineManager = employee);&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...and it all works!  It's a shame because I still like to use lambda expressions whereever possible because they're still new and cool (to me anyway).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In conclusion, be careful with hierarchies in WCF, and note that the error message that you get does not neccessarily reflect the underlying cause.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-461640635281102007?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/461640635281102007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=461640635281102007' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/461640635281102007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/461640635281102007'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/05/problems-with-recursion-in-wcf.html' title='Problems with recursion in WCF serialization (hierarchical structures)'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_TRDeiMVJzrs/SgGyx7UmXvI/AAAAAAAAABI/Af8iAAtsBso/s72-c/EmployeeDatabaseTable.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-8131909513639222884</id><published>2009-04-28T15:39:00.000Z</published><updated>2009-04-28T16:51:53.702Z</updated><title type='text'>Create GUID not working in Visual Studio 2008</title><content type='html'>I have had a problem on my super new dev image for BizTalk 2009 / SQL 2008 / Visual Studio 2008 / Windows 2008.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In Visual Studio, when I go to tools --&gt; Create GUID it is greyed out.  What a pain!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, a helpful website that replaces the Create GUID functionality is here (actually you couldhave guessed it): &lt;a href="http://www.guidgen.com/Index.aspx"&gt;http://www.guidgen.com/Index.aspx&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-8131909513639222884?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/8131909513639222884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=8131909513639222884' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8131909513639222884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/8131909513639222884'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/04/create-guid-not-working-in-visual.html' title='Create GUID not working in Visual Studio 2008'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-1318669893280792393</id><published>2009-04-23T14:26:00.002Z</published><updated>2009-04-23T14:34:57.634Z</updated><title type='text'>SQL Server 2008 - Can't Save Table Changes</title><content type='html'>I am just playing around with a new image at the moment that has BizTalk 2009, SQL 2008 and Visual Studio 2008.  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I thought that in order to try out some of the features of BizTalk 2009 that I would make a sample solution that contained a WCF service, BizTalk orchestration and associated schemas for calling the service and mapping the result.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I just happened to have forgotten a field in a data table behind my service.  Not to worry I thought, just add the column and then regenerate the LINQ .dbml.  However, my table has timestamps and audit stuff like that in the last columns and I wanted to put my new data field further up, so using the UI on SQL Management Studio 2008 I duly inserted a column, set the properties and clicked on save.  What I got was the following error in a dialogue:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 204, 204); font-family: 'Trebuchet MS'; font-size: 14px; line-height: 17px; "&gt;"Saving changes is not permitted. The changes you have made require the following tables to be dropped and re-created. You have either made changes to a table that can't be re-created or enabled the option Prevent saving changes that require the table to be re-created."&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Bugger.  What can the matter be?  Why can't I even save a table?  It turns out that there is a setting in SQL Server Managemet Studio that won't allow table changes if they result in a recreation of the table.  Note that I inserted a column between existing columns in the database.  For years now, behind the scenes SQL Server has generated a script that removes constraints, renames the current table, creates the new version of the table and then bulk loads the data into it, finally dropping the original (and now renamed) table.  Of course, when you have a production system this sort of script can be a very dodgy thing to run while the database is operating as you lose referential integrity while the script is running.  Hence it is a "good thing" for it to be disabled by default.  However, for a dev environment, especially one where I am doing a proof of concept....nah.  No thanks.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Have a look at this post on the simple steps on how to resolve.  &lt;a href="http://www.henrycordes.nl/post/2008/11/Saving-changes-is-not-permitted-(SQL-Server-2008).aspx"&gt;http://www.henrycordes.nl/post/2008/11/Saving-changes-is-not-permitted-(SQL-Server-2008).aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-1318669893280792393?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/1318669893280792393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=1318669893280792393' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1318669893280792393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/1318669893280792393'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/04/sql-server-2008-cant-save-table-changes.html' title='SQL Server 2008 - Can&apos;t Save Table Changes'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-5771455801657938195</id><published>2009-04-21T07:37:00.000Z</published><updated>2009-04-21T13:03:30.310Z</updated><title type='text'>A Description of a BPM Architecture</title><content type='html'>&lt;div style="text-align: left;"&gt;In the course of my work as an architect, working as I do for a consultancy specialising in integration and business process management (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;BPM&lt;/span&gt;), I am often called upon to design solution architectures in the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;BPM&lt;/span&gt; space and also to lead development teams delivering these solutions.  I thought I'd take the opportunity here to give a brief introduction to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;BPM&lt;/span&gt; architectures, the elements contained within them and illustrate this with an example architecture.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;What is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;BPM&lt;/span&gt;?&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Without trying to copy the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;Wikipedia&lt;/span&gt; entry, Business Process Management systems are those that are implemented to support business processes in their wider sense, as opposed to "Line of Business" systems that are traditionally more functionally aligned and therefore operate as "silos" of data.  Whilst &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;BPM&lt;/span&gt; systems do not remove the need for or relevance of line of business systems, the aim is to combine such systems into a cohesive whole.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Business processes will be started, either manually or automatically, and require a certain trigger information set to kick them off.  This information set is then added to and manipulated by the business process until the process completes.  Sometimes the data itself is the objective of the business process, sometimes it just refers to physical things created as a result of the business process (order information, serial numbers &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;od&lt;/span&gt; widgets, courier tracking IDs) and sometimes just records of things that have occurred during the business process (notes on phone conversations, emails).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Essential elements of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;BPM&lt;/span&gt; solutions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What is common to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;BPM&lt;/span&gt; solutions is that these activities are co-ordinated into a process.  Some activities are automated by software systems, some of them are manual, but the timing of the activities and the information presented to the activities is co-ordinated.  In order to achieve this some form of process logic (e.g. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;workflow&lt;/span&gt; in its wider sense) is required.  At this point it is not &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;necessary&lt;/span&gt; to specify any specific technologies but we do need to have the process driven by our system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When we engage people in out activities, we will need to have a user interface for them to interact with.  Human activities will usually be triggered from some sort of notification that points to items in a task list, but once the people engaged in the process have started work on their task they will usually be presented with information on (a) what their task is, (b) the input data relating to that task and (c) form fields where they record the output data for the task.   This is all achieved by the user interface.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As mentioned above, there is a set of data that encompasses the overall business process, and we need to manage the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;superset&lt;/span&gt; of this information quite closely with our process.  This may require us to maintain pointers to records in other systems, it may require us to store duplicate information and it may require us to store master information, but a key feature of a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;BPM&lt;/span&gt; solution is that somewhere there is a central point from which we can reconstruct the data for the process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also, mentioned above, we said that line-of-business systems may still exist, but that they operate within functional boundaries in an organisation.  Our &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;BPM&lt;/span&gt; solution crosses functional boundaries, but that does not mean that an activity relating to a business function cannot interact with a line of business system.  Interactions with line of business systems come in two main forms.  One is human interaction.  A task may be to update or manipulate data in a separate system, the so-called "swivel-chair integration".  These types of integrations with line of business systems are the cheapest to implement because they are just co-ordinating manual activity, but they are the most expensive to run because the costs scale with usage as they require human activity.  In order to improve efficiency we must, wherever cost-effective to do so, make the interactions with line-of-business systems automated.  This requires us to have an integration capability.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Putting it all together&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It's now time to take a look at what such a system might look like in practice from a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;very &lt;/span&gt;high-level point of view:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TRDeiMVJzrs/Se2mMxQN6nI/AAAAAAAAABA/h4tKCbzPn9Y/s1600-h/BPM+Architecture.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_TRDeiMVJzrs/Se2mMxQN6nI/AAAAAAAAABA/h4tKCbzPn9Y/s400/BPM+Architecture.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5327096672559164018" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 281px; " /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You will probably see straight away from my diagram that my example &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;BPM&lt;/span&gt; architecture is build upon Service Oriented Architecture (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;SOA&lt;/span&gt;) principles.  It is impractical in a modern software ecosystem to achieve a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;BPM&lt;/span&gt; architecture without &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;SOA&lt;/span&gt;.  Also, as I design architectures on the Microsoft .Net platform, my services these days are typically &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;WCF&lt;/span&gt; rather than basic .&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;asmx&lt;/span&gt; SOAP services.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let's take a look at some of the elements in the diagram and fill in some of the details.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Application Services&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;In a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;BPM&lt;/span&gt; architecture, the application services are the heart of the system.  This is where the custom data access resides, to store our &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;superset&lt;/span&gt; of the process data.  The application services also act as an event processor, because (drawing on the concepts of event-driven architectures or EDA) we can view our interactions with the other parts of the systems in an event-style context (although in this case "events" really correlate to messages).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note also that the main elements of the system are decoupled through their service interfaces.  None of the components of the system needs to have any knowledge of the other parts except for how to exchange messages with them.  Note also that some of the service interactions are bi-directional.  No-one ever said that &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;SOA&lt;/span&gt; needed you to have separate publishers and consumers of web services.  In may ecosystems there may be a conversation of messages and this requires systems to both publish to and receive messages from other systems.  &lt;span class="Apple-style-span" style="font-style: italic;"&gt;[Note:  If this type of interaction is complex or involves a high number of systems, look at implementing an enterprise service bus (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;ESB&lt;/span&gt;) pattern.]&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Something that you may think of when you see the diagram for application services and see its three separate service endpoints is "you must have to duplicate a lot of service calls to support those three service endpoints".  Well yes, and no.  Remember that we will still in effect only have one business logic layer, and any of the service endpoints may expose some of that logic.  If we have to duplicate an operation on a service endpoint then it's not a problem because the underlying code is shared.  By keeping the service endpoints separate however we are forced to think more carefully about what operations each service needs to support, and we can make the security on the system more granular.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;Workflow&lt;/span&gt; Services&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This part of the system is responsible for the process flow in the system.  It will also contain the task lists for the human &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;workflow&lt;/span&gt; and will instruct any automated tasks, usually by making calls back to the application services.  These calls will then either be routed to other services for fulfilment or handed off to the integration services.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a number of technologies that may host the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;workflow&lt;/span&gt; services.  For highly automated systems this may be performed using the orchestration engine in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;BizTalk&lt;/span&gt; server.  For simple applications you may write and host &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;WF&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;workflows&lt;/span&gt;, or use one of the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;workflow&lt;/span&gt; systems built on top of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;WF&lt;/span&gt; such as K2 Black Pearl.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The key to this being a success lies in correctly decoupling the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;workflow&lt;/span&gt; logic from the application logic.  It is very easy to end up with a horrific merge between the two.  This is why I prefer to provide an endpoint on the application services for the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;workflow&lt;/span&gt; to use, so that the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;workflow&lt;/span&gt; contains the minimum amount of data possible (e.g. keys), and the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;workflow&lt;/span&gt; maintains the process state whereas the application services maintain the business data state.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Presentation Services&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;UI&lt;/span&gt; for the system can take many forms, but in current systems it is &lt;span class="Apple-style-span" style="font-style: italic;"&gt;usually&lt;/span&gt; a web &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;UI&lt;/span&gt;.  Note that some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;workflow&lt;/span&gt; systems provide a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;UI&lt;/span&gt; to view task lists and these are sometimes used out of convenience (hence the dotted line in the diagram), but in a more purist view of the architecture the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;worflow&lt;/span&gt; will be an "engine" that is not accessed directly by the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;UI&lt;/span&gt;.  The task lists will be retrieved by the application services and rendered into the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;UI&lt;/span&gt; separately.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As for technologies, it is now becoming common for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;BPM&lt;/span&gt; presentation services to be hosted within &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;SharePoint&lt;/span&gt; as this technology can handle authentication, authorisation and end-user customisation out of the box.  Alternatively, a custom ASP.Net website or portal may be used. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="text-decoration: underline;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Integration Services&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;This part of the system abstracts the interaction with other systems and associated automated processes, and presents the application services with a clean interface to use.  Interactions with other systems can require long-running asynchronous processes that require a separate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;runtime&lt;/span&gt;, and they may require the data in the original message to be transformed significantly.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In the world of .Net, the technology of choice for this part of the ecosystem is &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_46"&gt;BizTalk&lt;/span&gt; Server, and the new versions of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;BizTalk&lt;/span&gt; (2006 R2 and 2009) have excellent &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;WCF&lt;/span&gt; support, along with the traditional &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_49"&gt;BizTalk&lt;/span&gt; strengths of orchestration and message transformation.  It is rare to find a back-end system that cannot be integrated in some form using the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_50"&gt;BizTalk&lt;/span&gt; toolkit.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;A walk-through &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_51"&gt;BPM&lt;/span&gt; scenario&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am going to illustrate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_52"&gt;BPM&lt;/span&gt; in practice by overlaying a simple order fulfilment process on top of the architecture described above.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Imagine that we have a business that sells widgets to consumers.  We may have a warehouse system, a financial system and a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_53"&gt;CRM&lt;/span&gt; system to interact with.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The process starts when a customer goes onto our website and orders something.  In this model our website is actually just another line-of business system.  This results in a message being sent to our Integration Services which receives it reliably and forwards it on to the Application Services which then creates a new header record for the order and generates a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_54"&gt;uniqe&lt;/span&gt; key.  The application services then immediately fires up an instance of the appropriate &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_55"&gt;workflow&lt;/span&gt; via a call to &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_56"&gt;WorkFlow&lt;/span&gt; Services.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The activities that need to happen after this are several, and can be executed in parallel.  The order needs to be entered into the &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_57"&gt;CRM&lt;/span&gt; system (via Integration Services) and the financial system  (via Integration Services) , and the warehouse system needs to be queried as to whether it has stock to fulfil the process  (via Integration Services) .  If not we may need to trigger an ordering process and wait for delivery, or else we may want to instruct the warehouse system to pick the stock and &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_58"&gt;dispatch  (via Integration Services) . &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On dispatch we may then create a manual task  (within Workflow Services)  for the warehouseman to enter the courier's reference into the system for tracking (using Presentation Services).  We may then launch a long-running process that queries the courier's system every 2 hours until delivery notification is achieved (combination of Workflow Services calling through to Integration Services via Application Services). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Summary&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This simple example is not intended as a definitive design for BPM, and there are whole areas that we have not touched upon that are important factors in a BPM solution such as business rules, business activity monitoring (BAM) and feedback control loops.  We haven't even mentioned anything about process design, simulation and modelling either.  All I have been trying to achieve is to provide a small illustration of the sort of architecture you might find in a BPM solution and to fill in some of the conceptual gaps in the model.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hopefully before too long I will get some time to go into more detail about this important and emerging architectural topic.  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-5771455801657938195?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/5771455801657938195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=5771455801657938195' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5771455801657938195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/5771455801657938195'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/04/description-of-bpm-architecture.html' title='A Description of a BPM Architecture'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_TRDeiMVJzrs/Se2mMxQN6nI/AAAAAAAAABA/h4tKCbzPn9Y/s72-c/BPM+Architecture.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29598966.post-4120450353795114541</id><published>2009-04-16T10:23:00.003Z</published><updated>2009-04-16T10:35:22.038Z</updated><title type='text'>BizTalk BAM Portal configuration issue on Windows Server 2008</title><content type='html'>I'm back from my easter break and just spending a couple of days getting to grips with BizTalk 2009.  I have created a new virtual image with the following on it:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Windows Server 2008&lt;/div&gt;&lt;div&gt;SQL Server 2008&lt;/div&gt;&lt;div&gt;Visual Studio 2008&lt;/div&gt;&lt;div&gt;BizTalk Server 2009 Developer Edition&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have encountered an issue when configuring the BizTalk BAM Portal.  All of the usual features of BizTalk, including BAM itself, have configured without any problems, but when I try to configure the BAM Portal on the default web site I get the following error message when I double-click the error icon:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;Failed to validate BAM Portal Web Site (BAMPortal)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;For help, click: http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&amp;amp;ProdVer=3.8.368.0&amp;amp;EvtSrc=BAMPortal&amp;amp;EvtID=idsFailedToValidateWebsite&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;ADDITIONAL INFORMATION:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;The BAM Portal website Default Web Site is not valid. (Microsoft.BizTalk.Bam.CfgExtHelper.PortalHelper)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;For help, click: http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&amp;amp;ProdVer=3.8.368.0&amp;amp;EvtSrc=Microsoft.BizTalk.Bam.CfgExtHelper.PortalHelper&amp;amp;EvtID=error_InvalidPortal&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;------------------------------&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;Unknown error (0x80005000) (System.DirectoryServices)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 204, 255);"&gt;For help, click: http://go.microsoft.com/fwlink/events.asp?ProdName=Microsoft+BizTalk+Server+2009&amp;amp;ProdVer=3.8.368.0&amp;amp;EvtSrc=System.DirectoryServices&amp;amp;EvtID&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The solution:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Thanks to this link &lt;a href="http://social.technet.microsoft.com/Forums/en-US/biztalkediandas2/thread/9365ca62-061c-4f34-a68b-e0837d46f1ef"&gt;http://social.technet.microsoft.com/Forums/en-US/biztalkediandas2/thread/9365ca62-061c-4f34-a68b-e0837d46f1ef&lt;/a&gt; I was able to get a pointer to the fix that is required.  Here are the steps that I took:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 23px; "&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TRDeiMVJzrs/SecJChHsVjI/AAAAAAAAAA4/ZTiJc9xCDc8/s1600-h/servermanager.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_TRDeiMVJzrs/SecJChHsVjI/AAAAAAAAAA4/ZTiJc9xCDc8/s400/servermanager.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5325235023243925042" style="cursor: pointer; width: 400px; height: 266px; " /&gt;&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Open the Server Manager MMC snap-in (right-click on Computer and select the Manage option).&lt;/li&gt;&lt;li&gt;Expand the features node.&lt;/li&gt;&lt;li&gt;Select the Web Server node.&lt;/li&gt;&lt;li&gt;Look through the role services.  Check for IIS 6 Management Compatability and see if it says it is installed.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If not installed, click Add Role Services on right of screen.  Select the IIS 6 Management Compatability and install.&lt;/li&gt;&lt;li&gt;Go back to BizTalk configuration, the BAM Portal feature should now install without any issues.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_TRDeiMVJzrs/SecI4GTOkxI/AAAAAAAAAAw/j6X7afxKDTU/s1600-h/biztalkconfig.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_TRDeiMVJzrs/SecI4GTOkxI/AAAAAAAAAAw/j6X7afxKDTU/s400/biztalkconfig.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5325234844245857042" style="cursor: pointer; width: 400px; height: 326px; " /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29598966-4120450353795114541?l=blog.andrewrivers.co.uk' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.andrewrivers.co.uk/feeds/4120450353795114541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29598966&amp;postID=4120450353795114541' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/4120450353795114541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29598966/posts/default/4120450353795114541'/><link rel='alternate' type='text/html' href='http://blog.andrewrivers.co.uk/2009/04/biztalk-bam-portal-configuration-issue.html' title='BizTalk BAM Portal configuration issue on Windows Server 2008'/><author><name>Andrew</name><uri>http://www.blogger.com/profile/01319737766041565387</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://2.bp.blogspot.com/_TRDeiMVJzrs/S1N6O2ANuCI/AAAAAAAAADI/ljE6bkxkGdw/S220/AndrewProfilePic.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_TRDeiMVJzrs/SecJChHsVjI/AAAAAAAAAA4/ZTiJc9xCDc8/s72-c/servermanager.jpg' height='72' width='72'/><thr:total>5</thr:total></entry></feed>
