Andreas Erben's postshttp://developers.de/blogs/andreas_erben/atom.aspxCommunity Server2008-07-29T11:43:43ZDublin, Velocity and more bundled up as AppFabric/blogs/andreas_erben/archive/2009/11/17/dublin-velocity-and-more-bundled-up-as-appfabric.aspx2009-11-17T19:32:03Z2009-11-17T19:32:03Z<p>Microsoft is bundling up some functionality from previously separated product codenames, e.g. Velocity and Dublin and bundling them as <a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx">AppFabric</a>.</p> <p>Download the Beta here: <a href="http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx">http://msdn.microsoft.com/en-us/windowsserver/ee695849.aspx</a></p> <p>Interested in training on some of that new functionality? Contact me!</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=9118" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxExciting things for “Dublin” and “Velocity” coming up today, 11/17/2009/blogs/andreas_erben/archive/2009/11/17/exciting-things-for-dublin-and-velocity-coming-up-today-11-17-2009.aspx2009-11-17T15:29:57Z2009-11-17T15:29:57Z<p>Some exciting things for “Dublin” and “Velocity” will be given to the world today at Microsoft PDC 2009. Too bad that I am still under NDA for this :)</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=9114" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxVisual Studio 2010 Beta 2 availability/blogs/andreas_erben/archive/2009/10/19/visual-studio-2010-beta-2-availability.aspx2009-10-19T16:08:41Z2009-10-19T16:08:41Z<p>Mary Jo <a href="http://blogs.zdnet.com/microsoft/?p=4270">beat me to it</a>. Visual Studio 2010 Beta 2 is available.</p> <p>RTM March 22, 2010 (exact date? crazy! :) )</p> <p>Interesting is the new naming that includes “Visual Studio Ultimate”.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=8534" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspx.NET Services SDK March 2009 CTP and ASP.NET MVC RTM/blogs/andreas_erben/archive/2009/04/01/net-services-sdk-march-2008-ctp-and-asp-net-mvc.aspx2009-04-01T11:40:07Z2009-04-01T11:40:07Z<h3>Microsoft finally released a new CTP of the <a href="http://www.microsoft.com/azure/netservices.mspx">.NET Services</a> <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d1d1d5e-1332-4186-b33f-26d053759e49&displaylang=en">SDK, the March 2009 CTP</a></h3> <p>Personally, I think it is a very noteworthy release since it now allows for the first time to develop full blown applications in the <a href="http://www.microsoft.com/azure/workflow.mspx">Workflow Services</a> part of it:</p> <p>Now you can activate workflows from an external source, now you can receive messages from the Service Bus and because we have the while-loop, this basically allows all possible algorithms to be implemented in WF for “Cloud” (basically Turing-complete if they had no quotas/size restrictions for workflow definitions).</p> <p>Since I <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">blogged</a> <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/09/a-flow-control-in-the-cloud-flow-control-activities-amp-biztalk-workflow-services.aspx">extensively</a> <a href="http://developers.de/blogs/andreas_erben/archive/2008/09/29/workflow-cloudbusting-hidden-code-amp-logic-in-conditions-workflow-foundation-and-biztalk-workflow-services.aspx">about the</a> <a href="http://developers.de/blogs/andreas_erben/archive/2008/10/02/cloudy-messages-send-amp-receive-activities-in-biztalk-workflow-services.aspx">workflow</a> <a href="http://developers.de/blogs/andreas_erben/archive/2008/10/02/cloud-proxy-demo-simple-biztalk-workflow-services-end-to-end-demo.aspx">part</a> of BizTalk Services (how .NET Services were called before PDC08) and there was not much new in the workflow part of .NET Services compared to BizTalk Services until now, I was silent about this also. But this will cause me to revisit .NET Services. Stay tuned.</p> <p> </p> <p>The other noteworthy release is already a few weeks old:</p> <h3><a href="http://www.asp.net/mvc/">ASP.NET MVC</a> went RTM</h3> <p>This is a big thing since it can change the way we write ASP.NET applications quite a bit.</p> <p> </p> <p>Fellow readers: I have been offline for too long. Big changes happened that kept me more than just busy. And a lot of stuff I have been dealing with was stuff I was not allowed to talk about.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=4740" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxLive from PDC: Windows Azure/blogs/andreas_erben/archive/2008/10/27/live-from-pdc-windows-azure.aspx2008-10-27T16:19:10Z2008-10-27T16:19:10Z<p>Microsoft's new Platform for Cloud Computing: Windows Azure</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4348.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4348" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4348_5F00_thumb.jpg" width="644" border="0" /></a></p> <p> </p> <p>A key element is managing and modeling your services</p> <p> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4350.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4350" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4350_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4351.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4351" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4351_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4352.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4352" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.LivefromPDCWindowsAzure_5F00_82F7/100_5F00_4352_5F00_thumb.jpg" width="644" border="0" /></a></p> <p>All represented in XML</p> <p>This intro was then followed by demos, hello world and ...</p> <p>... "BlueHoo" another social-networking platform... YooHoo - blabla</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2963" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxPre-PDC architecture session around SOA vs Synchronization/blogs/andreas_erben/archive/2008/10/27/pre-pdc-architecture-session-around-soa-vs-synchronization.aspx2008-10-27T13:36:53Z2008-10-27T13:36:53Z<p>Damir, Edin and myself just had a long architecture session on how to combine SOA and synchronization concepts.</p> <p align="left"> The big problem is that participants in a communication share information across boundaries and beyond control of one participant only. They also might offer non-trivial logic where the semantics are not completely shared but that creates results that are then shared with other participants. No meaningful conflict-resolution algorithms can be defined.</p> <p>Here are some of our diagrams:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4286.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4286" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4286_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4296.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4296" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4296_5F00_thumb.jpg" width="644" border="0" /></a></p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4297.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4297" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4297_5F00_thumb.jpg" width="644" border="0" /></a></p> <p align="center"> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4298.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4298" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4298_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="center"> </p> <p align="center"> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4288.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="772" alt="100_4288" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4288_5F00_thumb.jpg" width="580" border="0" /></a> </p> <p align="left">Instead of agitatedly discussing about it...</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4319.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4319" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4319_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="left"> </p> <p align="left">Maybe we would get a better view on a solution from a different perspective: </p> <p align="left"> </p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4312.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4312" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.PrePDCarchitecturesessionaroundSOAvsSync_5F00_5C3E/100_5F00_4312_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p align="center"> </p> <p align="left"></p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2960" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxAndreas' Visual Intro Guide to PDC08/blogs/andreas_erben/archive/2008/10/26/andreas-visual-intro-guide-to-pdc08.aspx2008-10-26T15:49:04Z2008-10-26T15:49:04Z<p>First things first: Already a great crowd on the first day of the pre-conference. Met a bunch of nice people and old acquaintances and friends right away.</p> <p> </p> <h2>Step by step how to get to PDC from downtown Los Angeles</h2> <p>Walk in that direction</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4211.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4211" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4211_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p>Pass this on your right side</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4203.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4203" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4203_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p>Until you see this</p> <p> </p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4199.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4199" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4199_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p> </p> <p>Enter right there</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4197.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4197" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4197_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p> </p> <p>Register here and after that pass the registration booth on the right</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4195.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4195" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4195_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p> </p> <p>Go down here</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4187.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4187" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4187_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p> </p> <p>Choose a T-Shirt size</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4190.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4190" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4190_5F00_thumb.jpg" width="364" border="0" /></a> </p> <p>and pick up your stuff (before Tuesday you will only get a part of the SWAG).</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4188.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4188" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4188_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p>This is what you get on Sunday/Monday</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4220.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4220" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4220_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p><strong><font size="6">No Windows 7 or other BITS yet!</font></strong></p> <p> </p> <p>... do not forget to enjoy LA downtown when walking around</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4204.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="484" alt="100_4204" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4204_5F00_thumb.jpg" width="644" border="0" /></a> </p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4209.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="772" alt="100_4209" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4209_5F00_thumb.jpg" width="580" border="0" /></a> </p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4213.jpg"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="772" alt="100_4213" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.AndreasVisualIntroGuidetoPDC08_5F00_7BC9/100_5F00_4213_5F00_thumb.jpg" width="580" border="0" /></a> </p> <p> </p> <p>Stay tuned!</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2955" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxCloud Proxy Demo / Simple BizTalk Workflow Services End-to-end demo/blogs/andreas_erben/archive/2008/10/02/cloud-proxy-demo-simple-biztalk-workflow-services-end-to-end-demo.aspx2008-10-02T09:55:00Z2008-10-02T09:55:00Z<p>(German version may be written at a later time / Deutsche Version wird gegebenenfalls später geschrieben)</p>
<p>This post combines several concepts from several posts about <a href="http://labs.biztalk.net/workflow.aspx">BizTalk Workflow Services</a>. You should read <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">the intro</a>, about <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/09/a-flow-control-in-the-cloud-flow-control-activities-amp-biztalk-workflow-services.aspx">flow control</a>, about <a href="http://developers.de/blogs/andreas_erben/archive/2008/10/02/cloudy-messages-send-amp-receive-activities-in-biztalk-workflow-services.aspx">send&receive activities</a> and about <a href="http://developers.de/blogs/andreas_erben/archive/2008/09/29/workflow-cloudbusting-hidden-code-amp-logic-in-conditions-workflow-foundation-and-biztalk-workflow-services.aspx">the little trick to hide some code in conditions</a>. Additionally we will showcase binding of properties in BizTalk Workflow Services.</p>
<p>What shall be achieved?</p>
<p>We want a workflow instance to communicate with a service and be called back by the service. Then the workflow should do something and wait for the client to fetch the result of the work done.</p>
<p>Some challenges:</p>
<ol>
<li>How to get the WorkflowInstanceId to the service? </li>
<li>How to get information back to the workflow? </li>
<li>How to pass the information from one activity in the workflow to another activity? </li>
<li>How to get the information back to the service?</li>
</ol>
<h3>Challenge 1: How to get the WorkflowInstanceId to the service?</h3>
<p>There is currently no out-of-the-box way to access the WorkflowInstanceId and there is no "setter" activity to store a value somewhere. To do this, we will use the technique described in <a href="http://developers.de/blogs/andreas_erben/archive/2008/09/29/workflow-cloudbusting-hidden-code-amp-logic-in-conditions-workflow-foundation-and-biztalk-workflow-services.aspx">here, where we hide code in conditions</a> to send information via the CloudServiceBusSend activity to the service.</p>
<p>We will use the following condition for that.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span><span style="color:#0000ff;"><span style="color:#000000;">System.Convert.ToBoolean(((System.ServiceBus.Workflow.CloudServiceBusSend) this.GetActivityByName("cloudServiceBusSend1") ).GetType().GetProperty("Body").SetValue(this.GetActivityByName("cloudServiceBusSend1"), "<Echo xmlns='http://samples.microsoft.com/ServiceModel/Relay/'><text></text> </Echo>".Insert(69, this.WorkflowInstanceId.ToString()), null)) || True</span></span></p>
</div>
<p>Note that this condition results in an Xml-string that is longer than 8192 characters. You will have to strip whitespace from that Xml-string to be able to upload it to BizTalk Workflow Services.</p>
<h3>Challenge 2: How to get information back to the workflow?</h3>
<p>Fortunately we received the InstanceId, now we need to tell the workflow that we want it to do something for us. Unfortunately CloudServiceBusSend so far does not work with returned values. So: The only way to call the workflow is through the CloudHttpReceive activity and we need the InstanceId to call the proper instance. Using the CloudHttpReceive was demonstrated <a href="http://developers.de/blogs/andreas_erben/archive/2008/10/02/cloudy-messages-send-amp-receive-activities-in-biztalk-workflow-services.aspx">here</a>.</p>
<h3>Challenge 3: How to pass the information from one activity in the workflow to another activity?</h3>
<p>As mentioned, we have no activities for getting/setting or manipulating data. We could either employ the previously mentioned trick to hide some code in conditions or we can use property binding. We will do the latter.</p>
<p>We bind the request property of a CloudHttpReceive activity to the URL property of a CloudHttpSend activity. So, the URL of the CloudHttpSend will be "filled" by the incoming WebHttpRequest and when CloudHttpSend gets executed it will request data from the URL that was supplied externally.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;">Activity=cloudHttpSend1, Path=URL</p>
</div>
<p>The complete activity with activity binding would look like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">ns0:CloudHttpReceive</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{ActivityBind cloudHttpSend1,Path=URL}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpReceive1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Hello</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<h3>Challenge 4: How to get the information back to the service?</h3>
<p>To solve that challenge we can either use a CloudServiceBusSend or we can have the service asking the workflow via a CloudHttpReceive activity. We will use CloudHttpReceive in this case because we want the service to "control" when it asks for the result.</p>
<h2>The workflow</h2>
<p>Now let us look at the complete workflow first</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SendSbReceiveHttpWf1.png"><img border="0" width="240" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SendSbReceiveHttpWf1_5F00_thumb.png" alt="SendSbReceiveHttpWf1" height="575" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>and as Xoml definition:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowProject1.Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/2007/11/CloudWorkflowActivityLibrary</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudWhile1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleConditionReference</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConditionName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudSequence1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudServiceBusSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudServiceBusSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">sb://connect.biztalk.net/services/YOURUSERNAMEHERE/EchoService/</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>""<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Body</span><span style="color:#0000ff;">=</span>"<span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">Echo xmlns='http://samples.microsoft.com/ServiceModel/Relay/'</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">text</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">Original</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/text</span><span style="color:#ff0000;">&gt;&lt;</span><span style="color:#0000ff;">/Echo</span><span style="color:#ff0000;">&gt;</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Action</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://samples.microsoft.com/ServiceModel/Relay/EchoContract/Echo</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConnectionMode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">RelayedDuplexSession</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudHttpReceive</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{ActivityBind cloudHttpSend1,Path=URL}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpReceive1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Hello</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudHttpSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://www.microsoft.com</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Method</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GET</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">RequestContentType</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{ActivityBind cloudHttpReceive2,Path=Response}</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudHttpReceive</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpReceive2</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Bye</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudDelay</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudDelay1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Timeout</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">00:00:10</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;">></span></p>
</div>
<p>Let's look at the activities from top to bottom.</p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudSequence1Properties_5F00_2.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudSequence1Properties_5F00_thumb.png" alt="cloudSequence1Properties" height="246" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>There is not really anything to say about cloudSequence1.</p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudWhile1Properties_5F00_6.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudWhile1Properties_5F00_thumb_5F00_2.png" alt="cloudWhile1Properties" height="357" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>The cloudWhile1 activity has the condition set as seen in Challenge 1.</p>
<p>The condition is represented by this Xml structure:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Operator</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">BooleanOr</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Left</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:Int32</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>69<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:Int32</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">ToString</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">PropertyName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowInstanceId</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Insert</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span><span style="color:#ff0000;">&lt;</span>Echo xmlns='http://samples.microsoft.com/ServiceModel/Relay/'<span style="color:#ff0000;">&gt;&lt;</span>text<span style="color:#ff0000;">&gt;&lt;</span>/text<span style="color:#ff0000;">&gt; &lt;</span>/Echo<span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">SetValue</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>Body<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetProperty</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetType</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">TargetType</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.ServiceBus.Workflow.CloudServiceBusSend, System.ServiceBus.Workflow, Version=0.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">ToBoolean</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeTypeReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Type</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.Convert, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Left</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Right</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>true<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Right</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;">></span></p>
</div>
<p>For "copy/paste" purposes, here is the whitespace-stripped Xml-representation:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Operator</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">BooleanOr</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Left</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:Int32</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>69<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:Int32</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">ToString</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">PropertyName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowInstanceId</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePropertyReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Insert</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span><span style="color:#ff0000;">&lt;</span>Echo xmlns='http://samples.microsoft.com/ServiceModel/Relay/'<span style="color:#ff0000;">&gt;&lt;</span>text<span style="color:#ff0000;">&gt;&lt;</span>/text<span style="color:#ff0000;">&gt; &lt;</span>/Echo<span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;"> /></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">SetValue</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>Body<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetProperty</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetType</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">TargetType</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.ServiceBus.Workflow.CloudServiceBusSend, System.ServiceBus.Workflow, Version=0.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">ToBoolean</span>"<span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeTypeReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Type</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.Convert, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;"> /></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Left</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Right</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">><</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>true<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression.Right</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">ns0:CodeBinaryOperatorExpression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">></</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;">></span></p>
</div>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudServiceBusSend1Properties_5F00_4.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudServiceBusSend1Properties_5F00_thumb_5F00_1.png" alt="cloudServiceBusSend1Properties" height="357" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>cloudServiceBusSend1 is configured like this with the "Body" property actually at execution time being overwritten by the condition of cloudWhile1.</p>
<p> </p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpReceive1Properties_5F00_2.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpReceive1Properties_5F00_thumb.png" alt="cloudHttpReceive1Properties" height="357" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>cloudHttpReceive1 will get data in the "Request" property and put it into the "URL" property of cloudHttpSend1.</p>
<p> </p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpSend1Properties_5F00_2.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpSend1Properties_5F00_thumb.png" alt="cloudHttpSend1Properties" height="377" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>cloudHttpSend1 will find it's URL property overwritten by the data received at cloudHttpReceive1. Then it will execute the WebHttpRequest and put the body of the result in the "Response" property of cloudHttpReceive2.</p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpReceive2Properties_5F00_2.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudHttpReceive2Properties_5F00_thumb.png" alt="cloudHttpReceive2Properties" height="357" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>cloudHttpReceive2 looks very empty. The "Response" property however will be overwritten by the data bound in cloudHttpSend1.</p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudDelay1Properties_5F00_2.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/cloudDelay1Properties_5F00_thumb.png" alt="cloudDelay1Properties" height="290" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>cloudDelay1 is configured to wait 10 seconds.</p>
<p>Create this workflow by copy/pasting the Xoml and rules and setting the type name to "SimpleEnd2End".</p>
<h2>The service</h2>
<p>Now you need to set up the service. To do that work on a copy of <i>Program Files\Microsoft BizTalk Services SDK\Samples\Communication\GettingStarted\Echo.</i></p>
<p>You will need to modify the file "<strong><em>EchoService.cs</em></strong>".</p>
<p>Modify the "using" statements like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.ServiceModel;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.Threading;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.Net;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.IO;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.Text;</p>
</div>
<p>Copy the methods "<em>CallHttpReceiveActivityWithLogin</em>", "<em>GetTokenGrantingToken</em>" and "<em>CallHttpReceiveActivity</em>" from the code snippet at the bottom of <a href="http://developers.de/blogs/andreas_erben/archive/2008/10/02/cloudy-messages-send-amp-receive-activities-in-biztalk-workflow-services.aspx">send&receive activities</a> to the class "<em>EchoService</em>".</p>
<p>Modify the "<em>Echo</em>"-method like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> Echo(<span style="color:#0000ff;">string</span> text)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(text + <span style="color:#a31515;">":InstanceId received"</span>);</p>
<p style="margin:0px;"> Threading.<span style="color:#2b91af;">ThreadStart</span> starter = <span style="color:#0000ff;">delegate</span> { HttpCall(text); };</p>
<p style="margin:0px;"> <span style="color:#0000ff;">new</span> Threading.<span style="color:#2b91af;">Thread</span>(starter).Start();</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> <span style="color:#a31515;">"nothing to return really"</span>; </p>
<p style="margin:0px;">}</p>
</div>
<p>You see that a new thread will be started with a delegate to HttpCall(text). This is because the service shall continue processing after returning from the "<em>Echo</em>"-method </p>
<p>Add a method "<em>HttpCall</em>" like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> HttpCall(<span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId+<span style="color:#a31515;">":Thread started"</span>);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> username = <span style="color:#a31515;">"YOURUSERNAME"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> password = <span style="color:#a31515;">"YOURPASSWORD"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName = <span style="color:#a31515;">"SimpleEnd2End"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> activityName1 = <span style="color:#a31515;">"cloudHttpReceive1"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> activityName2 = <span style="color:#a31515;">"cloudHttpReceive2"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> dummyString = <span style="color:#a31515;">"does not matter"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> urlToGet = <span style="color:#a31515;">"http://www.daenet.eu"</span>;</p>
<p style="margin:0px;"> <span style="color:#008000;">//wait a bit before the first call</span></p>
<p style="margin:0px;"> <span style="color:#2b91af;">Thread</span>.Sleep(1000);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":request "</span>+urlToGet);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> result1 = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> urlToGet, username, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName1,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> <span style="color:#008000;">//wait a bit before the second call to allow loading of URL</span></p>
<p style="margin:0px;"> <span style="color:#2b91af;">Thread</span>.Sleep(5000);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":retrieve data for "</span></p>
<p style="margin:0px;"> + urlToGet);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> result2 = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> dummyString, username, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName2,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":WebHttpResponse length "</span></p>
<p style="margin:0px;"> + result2.Length);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":Thread exits"</span>);</p>
<p style="margin:0px;">}</p>
</div>
<p>After some initialization this method waits for 1 second and then does a WebHttpRequest to the activity cloudHttpReceive1, sending "<a href="http://www.daenet.eu">http://www.daenet.eu</a>" in the body of the request (which will then overwrite "<a href="http://www.microsoft.com">http://www.microsoft.com</a>" in the cloudHttpSend1 activity). At the same time the workflow in the cloud should continue and retrieve the wanted data. Then it waits another 5 seconds and executes another WebHttpRequest, but this time to the activity cloudHttpReceive2, where it will retrieve the result of what the workflow hopefully loaded meanwhile from the passed URL. Some output is printed to the console and the method and thread exits.<br />Please note that the workflow itself however will loop endlessly and likely block at some point since it may reach a CloudHttpReceive when there is nobody to send anymore.</p>
<p> </p>
<p>For your convenience, the complete code of the modified file "<strong><em>EchoService.cs</em></strong>":</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#008000;">//---------------------------------------------------------------------------------</span></p>
<p style="margin:0px;"><span style="color:#008000;">// Microsoft (R) BizTalk Services</span></p>
<p style="margin:0px;"><span style="color:#008000;">// Software Development Kit</span></p>
<p style="margin:0px;"><span style="color:#008000;">// </span></p>
<p style="margin:0px;"><span style="color:#008000;">// Copyright (c) Microsoft Corporation. All rights reserved. </span></p>
<p style="margin:0px;"><span style="color:#008000;">// Copyright (c) of modifications: Andreas Erben</span></p>
<p style="margin:0px;"><span style="color:#008000;">// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, </span></p>
<p style="margin:0px;"><span style="color:#008000;">// EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES </span></p>
<p style="margin:0px;"><span style="color:#008000;">// OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. </span></p>
<p style="margin:0px;"><span style="color:#008000;">//---------------------------------------------------------------------------------</span></p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"><span style="color:#0000ff;">namespace</span> System.ServiceBus.Samples</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System.ServiceModel;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System.Threading;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System.Net;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System.IO;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> System.Text;</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> [<span style="color:#2b91af;">ServiceBehavior</span>(Name = <span style="color:#a31515;">"EchoService"</span>,</p>
<p style="margin:0px;"> Namespace = <span style="color:#a31515;">"http://samples.microsoft.com/ServiceModel/Relay/"</span>)]</p>
<p style="margin:0px;"> <span style="color:#0000ff;">class</span> <span style="color:#2b91af;">EchoService</span> : <span style="color:#2b91af;">EchoContract</span></p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> Echo(<span style="color:#0000ff;">string</span> text)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(text + <span style="color:#a31515;">":InstanceId received"</span>);</p>
<p style="margin:0px;"> Threading.<span style="color:#2b91af;">ThreadStart</span> starter = <span style="color:#0000ff;">delegate</span> { HttpCall(text); };</p>
<p style="margin:0px;"> <span style="color:#0000ff;">new</span> Threading.<span style="color:#2b91af;">Thread</span>(starter).Start();</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> <span style="color:#a31515;">"nothing to return really"</span>; </p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> HttpCall(<span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId+<span style="color:#a31515;">":Thread started"</span>);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> username = <span style="color:#a31515;">"YOURUSERNAME"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> password = <span style="color:#a31515;">"YOURPASSWORD"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName = <span style="color:#a31515;">"SimpleEnd2End"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> activityName1 = <span style="color:#a31515;">"cloudHttpReceive1"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> activityName2 = <span style="color:#a31515;">"cloudHttpReceive2"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> dummyString = <span style="color:#a31515;">"does not matter"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> urlToGet = <span style="color:#a31515;">"http://www.daenet.eu"</span>;</p>
<p style="margin:0px;"> <span style="color:#008000;">//wait a bit before the first call</span></p>
<p style="margin:0px;"> <span style="color:#2b91af;">Thread</span>.Sleep(1000);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":request "</span>+urlToGet);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> result1 = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> urlToGet, username, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName1,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> <span style="color:#008000;">//wait a bit before the second call to allow loading of URL</span></p>
<p style="margin:0px;"> <span style="color:#2b91af;">Thread</span>.Sleep(5000);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":retrieve data for "</span></p>
<p style="margin:0px;"> + urlToGet);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> result2 = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> dummyString, username, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName2,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":WebHttpResponse length "</span></p>
<p style="margin:0px;"> + result2.Length);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(instanceId + <span style="color:#a31515;">":Thread exits"</span>);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> password,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> token = GetTokenGrantingToken(username, password);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> requestBody, username, token,</p>
<p style="margin:0px;"> workflowTypeName, activityName,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> GetTokenGrantingToken(<span style="color:#0000ff;">string</span> userName, <span style="color:#0000ff;">string</span> password)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> tokenUrl = <span style="color:#0000ff;">string</span>.Format(</p>
<p style="margin:0px;"> <span style="color:#a31515;">"https://{0}/issuetoken.aspx?u={1}&p={2}"</span>,</p>
<p style="margin:0px;"> <span style="color:#a31515;">"identity.biztalk.net"</span>,</p>
<p style="margin:0px;"> userName,</p>
<p style="margin:0px;"> password);</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> tokenRequest = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">WebRequest</span>.Create(tokenUrl);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> tokenResponse = (<span style="color:#2b91af;">HttpWebResponse</span>)tokenRequest.GetResponse();</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = tokenResponse.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] tokenBody = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">byte</span>[500];</p>
<p style="margin:0px;"> <span style="color:#0000ff;">int</span> tokenBodyLength = responseStream.Read(tokenBody, 0, 500);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> <span style="color:#2b91af;">Encoding</span>.UTF8.GetString(tokenBody, 0, tokenBodyLength);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> token,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Uri</span> address = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">Uri</span>(<span style="color:#a31515;">@"http://workflow.biztalk.net/servicesHttp/"</span></p>
<p style="margin:0px;"> + username + <span style="color:#a31515;">"/workflows/"</span> + workflowTypeName +</p>
<p style="margin:0px;"> <span style="color:#a31515;">"/instances/"</span> + instanceId + <span style="color:#a31515;">"/"</span> + activityName);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> request = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">HttpWebRequest</span>.Create(address);</p>
<p style="margin:0px;"> <span style="color:#008000;">//this adds the retrieved token as a header</span></p>
<p style="margin:0px;"> request.Headers.Add(<span style="color:#a31515;">"X-MS-Identity-Token"</span>, token);</p>
<p style="margin:0px;"> request.Method = <span style="color:#a31515;">"POST"</span>;</p>
<p style="margin:0px;"> request.ContentType = <span style="color:#a31515;">"text/plain"</span>;</p>
<p style="margin:0px;"> <span style="color:#008000;">//send the body</span></p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] requestBodyBytes = <span style="color:#2b91af;">Encoding</span>.UTF8.GetBytes(requestBody);</p>
<p style="margin:0px;"> request.ContentLength = requestBodyBytes.Length;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> requestStream = request.GetRequestStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> requestStream.Write(requestBodyBytes, 0, requestBodyBytes.Length);</p>
<p style="margin:0px;"> requestStream.Flush();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> response = (<span style="color:#2b91af;">HttpWebResponse</span>)request.GetResponse();</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = response.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">StreamReader</span> reader = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StreamReader</span>(responseStream,</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Encoding</span>.UTF8))</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> reader.ReadToEnd();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;">}</p>
</div>
<p> </p>
<h2>Running the sample</h2>
<ol>
<li>Start the modifed "<em>Echo</em>"-sample that will start-up its self-hosted ServiceBus endpoint.</li>
<li>Create 1 or more instances of the type SimpleEnd2End.</li>
<li>Start the instances of SimpleEnd2End.</li>
<li>Watch the output in the console of the modified "<em>Echo</em>"-sample until you are happy and press enter.</li>
</ol>
<h3>The output for 1 workflow instance:</h3>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p>d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:InstanceId received<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:Thread started<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:WebHttpResponse length 28427<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:Thread exits<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:InstanceId received<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:Thread started<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:WebHttpResponse length 28427<br />d81d8ba2-3137-4a6d-aafe-c6c8c5eea1a8:Thread exits</p>
</div>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SimpleEnd2EndOutput1Instance.png"><img border="0" width="607" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SimpleEnd2EndOutput1Instance_5F00_thumb.png" alt="SimpleEnd2EndOutput1Instance" height="155" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p> </p>
<h3>The output for 2 concurrent workflow instances:</h3>
<h3></h3>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p>a7874223-e9d1-430c-b0f9-d36baf6d1076:InstanceId received<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:Thread started<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />befa13cf-4b4c-4118-82dc-4a94ef288952:InstanceId received<br />befa13cf-4b4c-4118-82dc-4a94ef288952:Thread started<br />befa13cf-4b4c-4118-82dc-4a94ef288952:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />a7874223-e9d1-430c-b0f9-d36baf6d1076:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />befa13cf-4b4c-4118-82dc-4a94ef288952:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />a7874223-e9d1-430c-b0f9-d36baf6d1076:WebHttpResponse length 28427<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:Thread exits<br />befa13cf-4b4c-4118-82dc-4a94ef288952:WebHttpResponse length 28427<br />befa13cf-4b4c-4118-82dc-4a94ef288952:Thread exits<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:InstanceId received<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:Thread started<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />befa13cf-4b4c-4118-82dc-4a94ef288952:InstanceId received<br />befa13cf-4b4c-4118-82dc-4a94ef288952:Thread started<br />befa13cf-4b4c-4118-82dc-4a94ef288952:request <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />a7874223-e9d1-430c-b0f9-d36baf6d1076:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />befa13cf-4b4c-4118-82dc-4a94ef288952:retrieve data for <a href="http://www.daenet.eu"><span style="color:#000000;">http://www.daenet.eu</span></a><br />a7874223-e9d1-430c-b0f9-d36baf6d1076:WebHttpResponse length 28427<br />a7874223-e9d1-430c-b0f9-d36baf6d1076:Thread exits<br />befa13cf-4b4c-4118-82dc-4a94ef288952:WebHttpResponse length 28427<br />befa13cf-4b4c-4118-82dc-4a94ef288952:Thread exits</p>
</div>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SimpleEnd2EndOutput2Instances.png"><img border="0" width="611" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/SimpleEnd2EndOutput2Instances_5F00_thumb.png" alt="SimpleEnd2EndOutput2Instances" height="297" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p> </p>
<p>This is part of the actual retrieved data to be found in result2 when breaking after the second call to the workflow: </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/resultOutput_5F00_4.png"><img border="0" width="620" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudProxyBizTalkWorkflowServicesEndtoen_5F00_807B/resultOutput_5F00_thumb_5F00_1.png" alt="resultOutput" height="551" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Note that it will, as seen in the previous blog-post be wrapped in the XML representation of a string object containing the retrieved data. To get the actual data, you would need to parse that XML structure (even though it is a simple parse). </p>
<p>This is all for now, I hope it made <a href="http://labs.biztalk.net/workflow.aspx">BizTalk Workflow Services</a> more "accessible". </p>
<p> </p>
<p><span style="font-size:xx-small;">Finally some advertisment: </span><span style="font-size:xx-small;">If you want to talk to us/me about BizTalk Workflow Services or other exciting technologies or approaches then contact us/me. "face 2 face" logistics are most easy in the US or Europe.</span></p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2863" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxCloudy messages / Send & Receive Activities in BizTalk Workflow Services/blogs/andreas_erben/archive/2008/10/02/cloudy-messages-send-amp-receive-activities-in-biztalk-workflow-services.aspx2008-10-02T03:14:00Z2008-10-02T03:14:00Z<p>(German version may be provided at a later stage / Deutsche Version wird gegebenenfalls nachgereicht)</p>
<p>In previous posts, I gave an <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">introduction to BizTalk Workflow Services</a>, I <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/09/a-flow-control-in-the-cloud-flow-control-activities-amp-biztalk-workflow-services.aspx">wrote about flow control</a> and rambled about <a href="http://developers.de/blogs/andreas_erben/archive/2008/09/29/workflow-cloudbusting-hidden-code-amp-logic-in-conditions-workflow-foundation-and-biztalk-workflow-services.aspx">tricks you can do in conditions</a>.</p>
<p>This post will deal with the send and receive activities available now.</p>
<p>BizTalk Workflow Services offer the following send and receive activities:</p>
<ul>
<li>CloudHttpReceive <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpReceive" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </li>
<li>CloudHttpSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </li>
<li>CloudServiceBusSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.sbSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </li>
</ul>
<p> </p>
<h2>CloudServiceBusSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.sbSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a></h2>
<p>CloudServiceBusSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.sbSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> was already used in the introduction post, so I will start with this.</p>
<h3>CloudServiceBusSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.sbSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> with ConnectionMode RelayedMultiCast</h3>
<p>Please look at the provided sample typically at <i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\GettingStarted </i>and find the activity "cloudServiceBusSend1".</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/BizTalkServicesWorkflowGettingStarted01_5F00_2.png"><img border="0" width="483" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/BizTalkServicesWorkflowGettingStarted01_5F00_thumb.png" alt="BizTalkServicesWorkflowGettingStarted01" height="721" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>The activity corresponds to the following Xoml-fragment:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">ns0:CloudServiceBusSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudServiceBusSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">sb://connect.biztalk.net/services/ChatRooms/watchdog/MulticastService/</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Body</span><span style="color:#0000ff;">=</span>"<span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">Chat xmlns='http://samples.microsoft.com/ServiceModel/Relay/'</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">nickName</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">watchdog</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/nickName</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">text</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">The Microsoft site is responding.</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/text</span><span style="color:#ff0000;">&gt;&lt;</span><span style="color:#0000ff;">/Chat</span><span style="color:#ff0000;">&gt;</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Action</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConnectionMode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">RelayedMulticast</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<p> </p>
<p>Select cloudServiceBusSend1 and look at the properties:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/ServiceBusSendRelayedMultiCast_5F00_4.png"><img border="0" width="602" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/ServiceBusSendRelayedMultiCast_5F00_thumb_5F00_1.png" alt="ServiceBusSendRelayedMultiCast" height="352" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<h4><strong>ConnectionMode</strong></h4>
<p>There are two implemented ConnectionModes: "RelayedMultiCast" and "RelayedDuplexSession". <br />RelayedMultiCast requires a contract that only contains OneWay operations. "RelayedDuplexSession" in contrast will theoretically allow a response, but there seems to be a bug in the present version and the response will get lost. The posted example uses the "RelayedMultiCast" ConnectionMode. It interacts with the sample <i>Program Files\Microsoft BizTalk Services SDK\Samples\Communication\ExploringFeatures\ConnectionModes\Multicast</i>.</p>
<h4><strong>URL</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a title="sb://connect.biztalk.net/services/ChatRooms/watchdog/MulticastService/"><span style="color:#000000;">sb://connect.biztalk.net/services/ChatRooms/watchdog/MulticastService/</span></a></p>
</div>
<p>This is the URL of the ServiceBus address you are trying to reach. A WorkflowValidator will not only check it for being not empty but also use the scheme "sb".</p>
<h4><strong>Action</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a href="http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat" title="http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat</span></a></p>
</div>
<p>Nothing really surprising. It is best understood though when looking at the contract of the corresponding sample</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;">[<span style="color:#2b91af;">ServiceContract</span>(Name = <span style="color:#a31515;">"<span style="text-decoration:underline;"><strong><em>MulticastContract</em></strong></span>"</span>, Namespace = <span style="color:#a31515;">"<span style="text-decoration:underline;"><strong><em>http://samples.microsoft.com/ServiceModel/Relay/</em></strong></span>"</span>)]</p>
<p style="margin:0px;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">interface</span> <span style="color:#2b91af;">MulticastContract</span></p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> [<span style="color:#2b91af;">OperationContract</span>(IsOneWay=<span style="color:#0000ff;">true</span>)]</p>
<p style="margin:0px;"> <span style="color:#0000ff;">void</span> Hello(<span style="color:#0000ff;">string</span> nickName);</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> [<span style="color:#2b91af;">OperationContract</span>(IsOneWay = <span style="color:#0000ff;">true</span>)]</p>
<p style="margin:0px;"> <span style="color:#0000ff;">void</span> <span style="text-decoration:underline;"><strong><em>Chat</em></strong></span>(<span style="color:#0000ff;">string</span> nickName, <span style="color:#0000ff;">string</span> text);</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> [<span style="color:#2b91af;">OperationContract</span>(IsOneWay = <span style="color:#0000ff;">true</span>)]</p>
<p style="margin:0px;"> <span style="color:#0000ff;">void</span> Bye(<span style="color:#0000ff;">string</span> nickName);</p>
<p style="margin:0px;">}</p>
</div>
<p>So, it is basically <strong>Namespace+Name+Operation</strong>.</p>
<h4><strong>Body</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;"><Chat xmlns='</span><a href="http://samples.microsoft.com/ServiceModel/Relay/'"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/'</span></a><span style="color:#000000;">> <nickName>watchdog</nickName> <text>The Microsoft site is responding.</text></Chat></span></span></p>
</div>
<p>What is actually being sent. A WorkflowValidator will check if it is valid XML.<br />In this example you see the outer element being named "Chat" like the operation that is going to be called on the interface with the namespace "http://samples.microsoft.com/ServiceModel/Relay/" of the ServiceContract. Then there are two string parameters, each represented by an XML-Tag corresponding to the parameter names of the operation: "nickName" with its value "watchdog" and "text" with its value "The Microsoft site is responding.".</p>
<h4><strong>Response</strong></h4>
<p>The response is empty, with RelayedMultiCast it will always stay empty even after the call (since it only involves OneWay operations) and unfortunately in the present CTP drop I found it impossible so far to be filled.</p>
<p> </p>
<h3>CloudServiceBusSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.sbSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.sbSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> with ConnectionMode RelayedDuplexSession</h3>
<p>Let's look at a slightly different configuration for this activity</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">ns0:CloudServiceBusSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudServiceBusSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">sb://connect.biztalk.net/services/andreaserben/EchoService/</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>""<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Body</span><span style="color:#0000ff;">=</span>"<span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">Echo xmlns='http://samples.microsoft.com/ServiceModel/Relay/'</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">text</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">Original</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/text</span><span style="color:#ff0000;">&gt;&lt;</span><span style="color:#0000ff;">/Echo</span><span style="color:#ff0000;">&gt;</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Action</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://samples.microsoft.com/ServiceModel/Relay/EchoContract/Echo</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConnectionMode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">RelayedDuplexSession</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<p>with the properties being like </p>
<p> </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/ServiceBusSendRelayedDuplexSession_5F00_2.png"><img border="0" width="706" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/ServiceBusSendRelayedDuplexSession_5F00_thumb.png" alt="ServiceBusSendRelayedDuplexSession" height="340" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<h4><strong><span style="text-decoration:underline;">ConnectionMode</span></strong></h4>
<p>As mentioned "RelayedDuplexSession" will theoretically allow a response, but there seems to be a bug in the present version and the response will get lost. This example interacts with the sample <i>Program Files\Microsoft BizTalk Services SDK\Samples\Communication\GettingStarted\Echo</i>.</p>
<h4><strong>URL</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a title="sb://connect.biztalk.net/services/andreaserben/EchoService/"><span style="color:#000000;">sb://connect.biztalk.net/services/YOURWORKFLOWSERVICESUSERNAME/EchoService/</span></a></p>
</div>
<p>This is the URL of the ServiceBus address you are trying to reach in this case contains your username because this is how the "Echo" sample sets up its endpoint.</p>
<h4><strong>Action</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a href="http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat" title="http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/EchoContract/Echo</span></a></p>
</div>
<p>Again nothing really surprising. It is best understood though when looking at the contract of the corresponding sample</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;">[<span style="color:#2b91af;">ServiceContract</span>(Name = <span style="color:#a31515;">"EchoContract"</span>, Namespace = <span style="color:#a31515;">"http://samples.microsoft.com/ServiceModel/Relay/"</span>)]</p>
<p style="margin:0px;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">interface</span> <span style="color:#2b91af;">EchoContract</span></p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> [<span style="color:#2b91af;">OperationContract</span>]</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> Echo(<span style="color:#0000ff;">string</span> text);</p>
<p style="margin:0px;">}</p>
</div>
<p style="margin:0px;"> </p>
</div>
<p>Again it is <strong>Namespace+Name+Operation</strong>. (Note that this is <span style="text-decoration:underline;">not</span> a one-way operation now.)</p>
<h4><strong>Body</strong></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><Echo xmlns='<a href="http://samples.microsoft.com/ServiceModel/Relay/'"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/'</span></a>> <text>Original</text></Echo></p>
</div>
<p><br />The outer element is named "Echo" like the operation that is going to be called on the interface with the namespace "http://samples.microsoft.com/ServiceModel/Relay/" of the ServiceContract. Then there is the parameter "text" with its value "Original".</p>
<h4><strong>Response</strong></h4>
<p>The response is empty, here you would expect your value to show up that you get back from the ServiceBus as return values, however, it does not seem to work at the present time.</p>
<p> </p>
<h2>CloudHttpSend <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpSend.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpSend_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpSend" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </h2>
<p>Again look at the sample at <i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\GettingStarted </i>and this time find the activity cloudHttpSend1.</p>
<p>The activity corresponds to the following Xoml-fragment:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">ns0:CloudHttpSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://www.microsoft.com</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Method</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GET</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">RequestContentType</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<p>Select the activity and look at its properties:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CloudHttpSendGet_5F00_2.png"><img border="0" width="437" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CloudHttpSendGet_5F00_thumb.png" alt="CloudHttpSendGet" height="386" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p> </p>
<h4><strong>URL</strong></h4>
<h4></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a href="http://www.microsoft.comconnect.biztalk" title="sb://connect.biztalk.net/services/andreaserben/EchoService/"><span style="color:#000000;">http://www.microsoft.com</span></a></p>
</div>
<p>The address of the resource you want to access. The WorkflowValidator will allow the Uri-Schemes "http", "https" and "ftp". The URL has to be given in absolute format. (The actual access is done through HttpWebRequest).</p>
<p> </p>
<h4><strong>Method</strong></h4>
<h4></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><strong>GET</strong></p>
</div>
<p>Allowed values are "GET" and "POST".</p>
<h4><strong>RequestContentType</strong></h4>
<p>This only is being considered for the "POST"-method. An example would be "text/plain".</p>
<h4><strong>Request</strong></h4>
<p>This is only being considered for the "POST"-method. The string here will be written to the RequestStream of the HttpWebRequest by interpreting the the String as UTF8-encoded through <span style="color:#2b91af;">Encoding</span>.UTF8.GetBytes(REQUESTSTRING).</p>
<h4><strong>StatusCode</strong></h4>
<p>The StatusCode that the HTTP-Request receives will appear here after the call was being made.</p>
<h4><strong>Response</strong></h4>
<p>The "Response" property will contain the content of the ResponseStream of the HttpWebRequest interpreted as UTF8-encoded.</p>
<p> </p>
<p>There is really not much more to it, I will however try to give an end-to-end example that utilizes this activity in a bit more meaningful manner.</p>
<p> </p>
<h2>CloudHttpReceive <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpReceive" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </h2>
<p>CloudHttpReceive <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpReceive" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> is tough to impossible to figure out with the given documentation as to date.</p>
<p>Let me first quote the documentation:</p>
<blockquote>
<p><strong>CloudHttpReceive</strong>: This activity receives an HTTP request at the URI http://workflow.biztalk.net/servicesHttp/<UserName>/workflows/<WorkflowTypeName>/instances/<br /><InstanceId>/<ActivityName> and returns a response. The HTTP listener uses Identity service access control and the operation name "Send" </p>
<p>Properties </p>
<ul>
<li>Response: the HTTP content to send in response to the HTTP request </li>
<li>StatusCode: the HTTP status code to return in response to the HTTP request </li>
<li>Request: the content of the received HTTP request. This property is set by the activity when a request is received.</li>
</ul>
</blockquote>
<p>It sounds easier than it is.</p>
<p>This is the smallest possible workflow utilizing this activity:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/MinimalHttpReceiveWf.png"><img border="0" width="273" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/MinimalHttpReceiveWf_5F00_thumb.png" alt="MinimalHttpReceiveWf" height="262" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>and its corresponding Xoml-definition:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowProject1.Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/2007/11/CloudWorkflowActivityLibrary</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudHttpReceive</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpReceive1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Hello</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;">></span></p>
</div>
<p> </p>
<p>A closer look of the Xoml-fragment of that very simple cloudHttpReceive:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">ns0:CloudHttpReceive</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Request</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudHttpReceive1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">StatusCode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">0</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Hello</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<p>It corresponds to those properties:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CloudHttpReceiveHello_5F00_2.png"><img border="0" width="446" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CloudHttpReceiveHello_5F00_thumb.png" alt="CloudHttpReceiveHello" height="316" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p> </p>
<h4><strong>Request</strong></h4>
<p>This property will contain the string you received in the Request-Stream interpreted as UTF8-encoded.</p>
<h4><strong>Response</strong></h4>
<p>What you set here will be returned to the caller.</p>
<h4><strong>StatusCode</strong></h4>
<p>This is the statuscode that you will send to the caller.</p>
<p> </p>
<p>Log in to BizTalk Workflow Services and create a type named "MinimalHttpReceive" with that Xoml definition and click "save changes". </p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CreateMinimalHttpReceive_5F00_2.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CreateMinimalHttpReceive_5F00_thumb.png" alt="CreateMinimalHttpReceive" height="629" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>Note that you did not need to provide a rules definition.</p>
<p>Create an instance of that type and start it and look at your instance manager:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/StartMinimalHttpReceive_5F00_2.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/StartMinimalHttpReceive_5F00_thumb.png" alt="StartMinimalHttpReceive" height="492" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>Note the GUID of the workflow instance: <strong>7bf7a7c4-82f5-4935-9c03-62ba1e7991aa<br /></strong>This will vary for you and you will have to remember your own GUID.</p>
<p>Now start the workflow instance and go to this URL in your browser:</p>
<h4></h4>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#000000;">http://workflow.biztalk.net/servicesHttp/<strong>YOURUSERNAMEHERE</strong>/workflows/MinimalHttpReceive/instances/<strong>YOURGUIDHERE</strong>/cloudHttpReceive1</span></p>
</div>
<p>If your browser does not display the complete URL, here it is again as a link:<br /><span style="color:#000000;"><a href="http://workflow.biztalk.net/servicesHttp/YOURUSERNAMEHERE/workflows/MinimalHttpReceive/instances/YOURGUIDHERE/cloudHttpReceive1">http://workflow.biztalk.net/servicesHttp/<strong>YOURUSERNAMEHERE</strong>/workflows/<br />MinimalHttpReceive/instances/<strong>YOURGUIDHERE</strong>/cloudHttpReceive1</a></span></p>
<p>You should see something like this:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/HttpReceiveBrowserLogin_5F00_4.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/HttpReceiveBrowserLogin_5F00_thumb_5F00_1.png" alt="HttpReceiveBrowserLogin" height="508" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Now you need to log in with the username and password (or respective Information Card) that you used to create the workflow type and instance.</p>
<p>Then you should see something like that:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">string</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/2003/10/Serialization/</span>"<span style="color:#0000ff;">></span>Hello<span style="color:#0000ff;"></</span><span style="color:#a31515;">string</span><span style="color:#0000ff;">></span></p>
</div>
<p>Your workflow should have been changed to "Completed" state.</p>
<p>Now what is interesting here is that you do not receive a pure string "Hello" but actually an XML serialization representation of the object string with content "Hello".</p>
<p> </p>
<h3>Sending to CloudHttpReceive <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive.png"><img border="0" width="20" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/System.ServiceBus.Workflow.httpReceive_5F00_thumb.png" alt="System.ServiceBus.Workflow.httpReceive" height="20" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> programmatically</h3>
<p>Ok, but now how can you do this programmatically? As you might realize, the challenge is the need to "log in". Unfortunately you cannot just use NetworkCredentials to log in but need to make a little detour.</p>
<p>At first you need to retrieve a token for logging in. You can find an example how to do it in this sample: <i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\ExploringFeatures\CreateWorkflowAPIs </i>in Program.cs method GetTokenGrantingToken.</p>
<p>I took the liberty of modifying the method slightly and to remove any dependency to the SDK:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> GetTokenGrantingToken(<span style="color:#0000ff;">string</span> userName, <span style="color:#0000ff;">string</span> password)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> tokenUrl = <span style="color:#0000ff;">string</span>.Format(</p>
<p style="margin:0px;"> <span style="color:#a31515;">"https://{0}/issuetoken.aspx?u={1}&p={2}"</span>,</p>
<p style="margin:0px;"> <span style="color:#a31515;">"identity.biztalk.net"</span>,</p>
<p style="margin:0px;"> userName,</p>
<p style="margin:0px;"> password);</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> tokenRequest = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">WebRequest</span>.Create(tokenUrl);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> tokenResponse = (<span style="color:#2b91af;">HttpWebResponse</span>)tokenRequest.GetResponse();</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = tokenResponse.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] tokenBody = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">byte</span>[500];</p>
<p style="margin:0px;"> <span style="color:#0000ff;">int</span> tokenBodyLength = responseStream.Read(tokenBody, 0, 500);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> <span style="color:#2b91af;">Encoding</span>.UTF8.GetString(tokenBody, 0, tokenBodyLength);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;">}</p>
</div>
<p>It is pretty straightforward. Basically it is a simple HTTPS request to this URL:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><a href="https://identity.biztalk.net/issuetoken.aspx?u=YOURUSERNAME&p=YOURPASSWORD"><span style="color:#000000;">https://identity.biztalk.net/issuetoken.aspx?u=YOURUSERNAME&p=YOURPASSWORD</span></a></p>
</div>
<p>Now, the string that you received represents your token and you need to attach that as a header of type "<strong>X-MS-Identity-Token</strong>" to your WebHttpRequest you want to send to your workflow instance.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;">request.Headers.Add(<span style="color:#a31515;">"X-MS-Identity-Token"</span>, token);</p>
</div>
<p>This is the code-snipped for a method encapsulating the whole request:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> token,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">Uri</span> address = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">Uri</span>(<span style="color:#a31515;">@"http://workflow.biztalk.net/servicesHttp/"</span></p>
<p style="margin:0px;"> + username + <span style="color:#a31515;">"/workflows/"</span> + workflowTypeName +</p>
<p style="margin:0px;"> <span style="color:#a31515;">"/instances/"</span> + instanceId + <span style="color:#a31515;">"/"</span> + activityName);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> request = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">HttpWebRequest</span>.Create(address);</p>
<p style="margin:0px;"> <span style="color:#008000;">//this adds the retrieved token as a header</span></p>
<p style="margin:0px;"> request.Headers.Add(<span style="color:#a31515;">"X-MS-Identity-Token"</span>, token);</p>
<p style="margin:0px;"> request.Method = <span style="color:#a31515;">"POST"</span>;</p>
<p style="margin:0px;"> request.ContentType = <span style="color:#a31515;">"text/plain"</span>;</p>
<p style="margin:0px;"> <span style="color:#008000;">//send the body</span></p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] requestBodyBytes = <span style="color:#2b91af;">Encoding</span>.UTF8.GetBytes(requestBody);</p>
<p style="margin:0px;"> request.ContentLength = requestBodyBytes.Length;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> requestStream = request.GetRequestStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> requestStream.Write(requestBodyBytes, 0, requestBodyBytes.Length);</p>
<p style="margin:0px;"> requestStream.Flush();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> response = (<span style="color:#2b91af;">HttpWebResponse</span>)request.GetResponse();</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = response.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">StreamReader</span> reader = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StreamReader</span>(responseStream,</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Encoding</span>.UTF8))</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> reader.ReadToEnd();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;">}</p>
</div>
<p>You can combine both like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> password,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> token = GetTokenGrantingToken(username, password);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> requestBody, username, token,</p>
<p style="margin:0px;"> workflowTypeName, activityName,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;">}</p>
</div>
<p>And an example call to the same workflow instance that we accessed above through the browser would be:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">string</span> userName = <span style="color:#a31515;">"YOURUSERNAME"</span>;</p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> password = <span style="color:#a31515;">"YOURPASSWORD"</span>;</p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> workflowTypeName = <span style="color:#a31515;">"MinimalHttpReceive"</span>;</p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> activityName = <span style="color:#a31515;">"cloudHttpReceive1"</span>;</p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> instanceId = <span style="color:#a31515;">"7bf7a7c4-82f5-4935-9c03-62ba1e7991aa"</span>;<span style="color:#008000;">//YOUR GUID HERE INSTEAD</span></p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> requestBody=<span style="color:#a31515;">"Text to send to cloud"</span>;</p>
<p style="margin:0px;"><span style="color:#0000ff;">string</span> result = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> requestBody, userName, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName,</p>
<p style="margin:0px;"> instanceId);</p>
</div>
<p> </p>
<p>For the sake of completeness here the complete code together:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.Text;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.Net;</p>
<p style="margin:0px;"><span style="color:#0000ff;">using</span> System.IO;</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"><span style="color:#0000ff;">namespace</span> SendToHttpReceive</p>
<p style="margin:0px;">{</p>
<p style="margin:0px;"> <span style="color:#0000ff;">class</span> <span style="color:#2b91af;">Program</span></p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">void</span> Main(<span style="color:#0000ff;">string</span>[] args)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> userName = <span style="color:#a31515;">"YOURUSERNAME"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> password = <span style="color:#a31515;">"YOURPASSWORD"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName = <span style="color:#a31515;">"MinimalHttpReceive"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> activityName = <span style="color:#a31515;">"cloudHttpReceive1"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId = <span style="color:#a31515;">"7bf7a7c4-82f5-4935-9c03-62ba1e7991aa"</span>;<span style="color:#008000;">//YOUR GUID HERE INSTEAD</span></p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody=<span style="color:#a31515;">"Text to send to cloud"</span>;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> result = CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> requestBody, userName, password,</p>
<p style="margin:0px;"> workflowTypeName, activityName,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.WriteLine(result);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Console</span>.ReadLine();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivityWithLogin(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> password,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> token = GetTokenGrantingToken(username, password);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> requestBody, username, token,</p>
<p style="margin:0px;"> workflowTypeName, activityName,</p>
<p style="margin:0px;"> instanceId);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> GetTokenGrantingToken(<span style="color:#0000ff;">string</span> userName, <span style="color:#0000ff;">string</span> password)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> tokenUrl = <span style="color:#0000ff;">string</span>.Format(</p>
<p style="margin:0px;"> <span style="color:#a31515;">"https://{0}/issuetoken.aspx?u={1}&p={2}"</span>,</p>
<p style="margin:0px;"> <span style="color:#a31515;">"identity.biztalk.net"</span>,</p>
<p style="margin:0px;"> userName,</p>
<p style="margin:0px;"> password);</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> tokenRequest = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">WebRequest</span>.Create(tokenUrl);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> tokenResponse = (<span style="color:#2b91af;">HttpWebResponse</span>)tokenRequest.GetResponse();</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = tokenResponse.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] tokenBody = <span style="color:#0000ff;">new</span> <span style="color:#0000ff;">byte</span>[500];</p>
<p style="margin:0px;"> <span style="color:#0000ff;">int</span> tokenBodyLength = responseStream.Read(tokenBody, 0, 500);</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> <span style="color:#2b91af;">Encoding</span>.UTF8.GetString(tokenBody, 0, tokenBodyLength);</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">static</span> <span style="color:#0000ff;">string</span> CallHttpReceiveActivity(</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> requestBody, <span style="color:#0000ff;">string</span> username, <span style="color:#0000ff;">string</span> token,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> workflowTypeName, <span style="color:#0000ff;">string</span> activityName,</p>
<p style="margin:0px;"> <span style="color:#0000ff;">string</span> instanceId)</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">Uri</span> address = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">Uri</span>(<span style="color:#a31515;">@"http://workflow.biztalk.net/servicesHttp/"</span></p>
<p style="margin:0px;"> + username + <span style="color:#a31515;">"/workflows/"</span> + workflowTypeName +</p>
<p style="margin:0px;"> <span style="color:#a31515;">"/instances/"</span> + instanceId + <span style="color:#a31515;">"/"</span> + activityName);</p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebRequest</span> request = (<span style="color:#2b91af;">HttpWebRequest</span>)<span style="color:#2b91af;">HttpWebRequest</span>.Create(address);</p>
<p style="margin:0px;"> <span style="color:#008000;">//this adds the retrieved token as a header</span></p>
<p style="margin:0px;"> request.Headers.Add(<span style="color:#a31515;">"X-MS-Identity-Token"</span>, token);</p>
<p style="margin:0px;"> request.Method = <span style="color:#a31515;">"POST"</span>;</p>
<p style="margin:0px;"> request.ContentType = <span style="color:#a31515;">"text/plain"</span>;</p>
<p style="margin:0px;"> <span style="color:#008000;">//send the body</span></p>
<p style="margin:0px;"> <span style="color:#0000ff;">byte</span>[] requestBodyBytes = <span style="color:#2b91af;">Encoding</span>.UTF8.GetBytes(requestBody);</p>
<p style="margin:0px;"> request.ContentLength = requestBodyBytes.Length;</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> requestStream = request.GetRequestStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> requestStream.Write(requestBodyBytes, 0, requestBodyBytes.Length);</p>
<p style="margin:0px;"> requestStream.Flush();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#2b91af;">HttpWebResponse</span> response = (<span style="color:#2b91af;">HttpWebResponse</span>)request.GetResponse();</p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">Stream</span> responseStream = response.GetResponseStream())</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> </p>
<p style="margin:0px;"> <span style="color:#0000ff;">using</span> (<span style="color:#2b91af;">StreamReader</span> reader = <span style="color:#0000ff;">new</span> <span style="color:#2b91af;">StreamReader</span>(responseStream,</p>
<p style="margin:0px;"> <span style="color:#2b91af;">Encoding</span>.UTF8))</p>
<p style="margin:0px;"> {</p>
<p style="margin:0px;"> <span style="color:#0000ff;">return</span> reader.ReadToEnd();</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;"> }</p>
<p style="margin:0px;">}</p>
</div>
<p> </p>
<p>Running that against a running workflow instance will (not surprisingly) result in this output:</p>
<p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CallMinimalHttpReceiveActivityOutput_5F00_2.png"><img border="0" width="681" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.CloudymessagesSendReceiveActivitiesinBiz_5F00_33E3/CallMinimalHttpReceiveActivityOutput_5F00_thumb.png" alt="CallMinimalHttpReceiveActivityOutput" height="92" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p> </p>
<p>In a future post I will try to show an "end-to-end"-demo that actually integrates a lot of what was shown previously and achieves bidirectional communication with a service in the cloud and has your workflow doing something that the service requests.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2861" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxWorkflow Cloudbusting / Hiding code & logic in conditions in Workflow Foundation and BizTalk Workflow Services/blogs/andreas_erben/archive/2008/09/29/workflow-cloudbusting-hidden-code-amp-logic-in-conditions-workflow-foundation-and-biztalk-workflow-services.aspx2008-09-29T16:31:00Z2008-09-29T16:31:00Z<p>(German version may come at a later time / Deutsche Version wird eventuell nachgereicht)</p>
<p>First of all: Please play around with <a href="http://labs.biztalk.net/workflow.aspx">BizTalk Workflow Services</a> and share what you find out. I feel lonely ;)</p>
<p>This post deals with <a href="http://labs.biztalk.net/workflow.aspx">BizTalk Workflow Services</a>. However, most of it also applies to general Workflow Foundation.</p>
<p>You might notice that in the <a href="http://labs.biztalk.net/workflow.aspx">BizTalk Workflow Services</a> of the current <a href="http://labs.biztalk.net/GetStarted.aspx">BizTalk Labs SDK</a> you do not find any activities that allow you to "set" a value or to execute custom code.</p>
<p>This makes implementing complex logic practically impossible since you cannot react in a meaningful way to data that you get through a send/receive.</p>
<p>However, there is a "dirty" trick you can use: Hide your logic in a rules-condition.<br />The following is a proof-of-concept and there are likely things that could be done better :)</p>
<p>Take the same preparations as in my <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">intro to BizTalk Workflow Services</a> having your command line output up and running to receive and display messages. Remember what I wrote regarding <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/09/a-flow-control-in-the-cloud-flow-control-activities-amp-biztalk-workflow-services.aspx">flow control for BizTalk Workflow Services</a>.</p>
<p>Now look at this really simple workflow definition</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/RulesHackWFDiagram1.png"><img border="0" width="320" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/RulesHackWFDiagram1_5F00_thumb.png" alt="RulesHackWFDiagram1" height="639" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p> </p>
<p>and it's even simpler XOML representation (sorry that it will not fit in most web browsers - please copy/paste to read):</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowProject1.Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/2007/11/CloudWorkflowActivityLibrary</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudWhile1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleConditionReference</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConditionName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudSequence1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudIfElse</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudIfElse1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudIfElseBranch</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudIfElseBranch1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudIfElseBranch.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleConditionReference</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConditionName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">R</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudIfElseBranch.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudIfElseBranch</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudIfElse</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudServiceBusSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudServiceBusSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">sb://connect.biztalk.net/services/ChatRooms/watchdog/MulticastService/</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Body</span><span style="color:#0000ff;">=</span>"<span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">Chat xmlns='http://samples.microsoft.com/ServiceModel/Relay/'</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">nickName</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">watchdog</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/nickName</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">text</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">Original</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/text</span><span style="color:#ff0000;">&gt;&lt;</span><span style="color:#0000ff;">/Chat</span><span style="color:#ff0000;">&gt;</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Action</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConnectionMode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">RelayedMulticast</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudDelay</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudDelay1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Timeout</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">00:00:10</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;">></span></p>
</div>
<p>It looks pretty normal, right? In the CloudServiceBusSend activity you send a string saying "Original" to our "watchdog".</p>
<p>However, have a look at the rule expression referenced in </p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">RuleConditionReference</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConditionName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">R</span>"<span style="color:#0000ff;"> /></span></p>
</div>
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p>that looks pretty funny.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">System.Convert.ToBoolean(((System.ServiceBus.Workflow.CloudServiceBusSend)this.GetActivityByName("cloudServiceBusSend1")).GetType().GetProperty("Body").SetValue(this.GetActivityByName("cloudServiceBusSend1"), "<Chat xmlns='</span><a href="http://samples.microsoft.com/ServiceModel/Relay/'"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/'</span></a><span style="color:#000000;">> <nickName>watchdog</nickName> <text>Modified</text></Chat>", null))</span></span></p>
</div>
<p>What does it do? First of all, it makes sure, that the condition has a valid value through</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">System.Convert.ToBoolean(</span><span style="color:#000000;">)</span></span></p>
</div>
<p>Now, it will evaluate the inner "condition" that is in fact a hidden "set" command.<br />At first it gets the Activity "cloudServiceBusSend1" and ensures it is of the desired type through:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">(System.ServiceBus.Workflow.CloudServiceBusSend)this.GetActivityByName("cloudServiceBusSend1")</span></span></p>
</div>
<p>Then, no that type we get the type and get the property "Body". </p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">.GetType().GetProperty("Body")</span></span></p>
</div>
<p>on the property "Body" we execute SetValue </p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">.SetValue(targetObject, propertyValueObject, indexValuesObject[]</span><span style="color:#000000;">)</span></span></p>
</div>
<p>that takes three parameters. Relevant here is the Activity being the targetObjet and the value we want to set being a string.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">.SetValue(this.GetActivityByName("cloudServiceBusSend1"),</span></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">"<Chat xmlns='</span><a href="http://samples.microsoft.com/ServiceModel/Relay/'"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/'</span></a><span style="color:#000000;">> <nickName>watchdog</nickName> <text>Modified</text></Chat>",</span></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"><span style="color:#000000;">null)</span></span></p>
</div>
<p>Now what did we just do? We modified a property of an activity in the workflow so that, were the activity initialized this way it would send the string "Modified" to our "watchdog".</p>
<p>Now look at the output of the workflow. This gets really interesting:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogModified_5F00_2.png"><img border="0" width="207" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogModified_5F00_thumb_5F00_2.png" alt="WatchDogModified" height="42" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Even though the "If" condition got evaluated before the activity cloudServiceBusDelay1 got executed, the first time the activity still sent "Original" and <span style="text-decoration:underline;">not</span> "Modified". However, when the loop executed the second time, it displayed the string "Modified".</p>
<p>Think about it. This gives quite some insight about the order how things are done in WF. Well, admittedly, we did a property manipulation in a pretty nasty way here and there were no DependencyProperties involved and so on.</p>
<p>Now, just for your information, notice that the rules file for this rule is really long.</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>true<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:Boolean</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">R</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System.CodeDom;Assembly=System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span><span style="color:#ff0000;">&lt;</span>Chat xmlns='http://samples.microsoft.com/ServiceModel/Relay/'<span style="color:#ff0000;">&gt; &lt;</span>nickName<span style="color:#ff0000;">&gt;</span>watchdog<span style="color:#ff0000;">&lt;</span>/nickName<span style="color:#ff0000;">&gt; &lt;</span>text<span style="color:#ff0000;">&gt;</span>Modified<span style="color:#ff0000;">&lt;</span>/text<span style="color:#ff0000;">&gt;&lt;</span>/Chat<span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">SetValue</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>Body<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetProperty</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetType</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">TargetType</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.ServiceBus.Workflow.CloudServiceBusSend, System.ServiceBus.Workflow, Version=0.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns1</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System;Assembly=mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;">></span>cloudServiceBusSend1<span style="color:#0000ff;"></</span><span style="color:#a31515;">ns1:String</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression.Value</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodePrimitiveExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">GetActivityByName</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeThisReferenceExpression</span><span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeCastExpression.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeCastExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Parameters</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">MethodName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">ToBoolean</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CodeTypeReferenceExpression</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">Type</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">System.Convert, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression.TargetObject</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodReferenceExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression.Method</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CodeMethodInvokeExpression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition.Expression</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleExpressionCondition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">RuleDefinitions.Conditions</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">RuleDefinitions</span><span style="color:#0000ff;">></span></p>
</div>
<p> </p>
<p>Now, what if we change the workflow and the expression a bit:</p>
<p>We put the condition as a while-loop condition in this workflow:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/RulesHackWFDiagram2.png"><img border="0" width="285" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/RulesHackWFDiagram2_5F00_thumb.png" alt="RulesHackWFDiagram2" height="388" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>represented by this XOML:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowProject1.Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/2007/11/CloudWorkflowActivityLibrary</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudWhile1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">RuleConditionReference</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConditionName</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">While Condition</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile.Condition</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudSequence1</span>"<span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudDelay</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudDelay1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Timeout</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">00:00:10</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> <</span><span style="color:#a31515;">ns0:CloudServiceBusSend</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">cloudServiceBusSend1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">URL</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">sb://connect.biztalk.net/services/ChatRooms/watchdog/MulticastService/</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Response</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">{x:Null}</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Body</span><span style="color:#0000ff;">=</span>"<span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">Chat xmlns='http://samples.microsoft.com/ServiceModel/Relay/'</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">nickName</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">watchdog</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/nickName</span><span style="color:#ff0000;">&gt; &lt;</span><span style="color:#0000ff;">text</span><span style="color:#ff0000;">&gt;</span><span style="color:#0000ff;">Original</span><span style="color:#ff0000;">&lt;</span><span style="color:#0000ff;">/text</span><span style="color:#ff0000;">&gt;&lt;</span><span style="color:#0000ff;">/Chat</span><span style="color:#ff0000;">&gt;</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">Action</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://samples.microsoft.com/ServiceModel/Relay/MulticastContract/Chat</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">ConnectionMode</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">RelayedMulticast</span>"<span style="color:#0000ff;"> /></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudSequence</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"> </</span><span style="color:#a31515;">ns0:CloudWhile</span><span style="color:#0000ff;">></span></p>
<p style="margin:0px;"><span style="color:#0000ff;"></</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;">></span></p>
</div>
<p> </p>
<p>The condition itself looks like this:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;">System.Convert.ToBoolean(((System.ServiceBus.Workflow.CloudServiceBusSend)this.GetActivityByName("cloudServiceBusSend1")).GetType().GetProperty("Body").SetValue(this.GetActivityByName("cloudServiceBusSend1"), "<Chat xmlns='<a href="http://samples.microsoft.com/ServiceModel/Relay/'"><span style="color:#000000;">http://samples.microsoft.com/ServiceModel/Relay/'</span></a>> <nickName>watchdog</nickName> <text>Modified</text></Chat>", null)) || True</p>
</div>
<p>It has a small modification since we want to ensure that the loop occurs - we force it to be "true" by using an "OR" operation with "true" on the result of the first part.</p>
<p>Be surprised or not, now the output is:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogWhileCondition.png"><img border="0" width="209" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogWhileCondition_5F00_thumb.png" alt="WatchDogWhileCondition" height="102" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>So, this time the condition got evaluated the first time before the activities inside the composite "while" activity were dealt with.</p>
<p> </p>
<p>For those who cannot get enough and do not believe me that the condition gets evaluated and thus executed after every loop, I prepared a more complex condition to use in the earlier "IF-condition version" of the workflow:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"></span></p>
<p style="margin:0px;">System.Convert.ToBoolean(((System.ServiceBus.Workflow.CloudServiceBusSend)this.GetActivityByName("cloudServiceBusSend1")).GetType().GetProperty("Body").SetValue(this.GetActivityByName("cloudServiceBusSend1"), System.DateTime.Now.ToString("\\<\\C\\h\\a\\t\\ \\x\\m\\l\\n\\s\\=\\'\\h\\t\\t\\p\\:\\/\\/\\s\\a\\m\\p\\l\\e\\s\\.\\m\\i\\c\\r\\o\\s\\o\\f\\t\\.\\c\\o\\m\\/\\S\\e\\r\\v\\i\\c\\e\\M\\o\\d\\e\\l\\/\\R\\e\\l\\a\\y\\/\\'\\>\\<\\n\\i\\c\\k\\N\\a\\m\\e\\>\\w\\a\\t\\c\\h\\d\\o\\g\\<\\/\\n\\i\\c\\k\\N\\a\\m\\e\\>\\<\\t\\e\\x\\t\\>yyyyMMddHHmmss\\<\\/\\t\\e\\x\\t\\>\\<\\/\\C\\h\\a\\t\\>"), null))</p>
</div>
<p>The big difference is that I output the actual DateTime instead of "Modified".</p>
<p>If you ask yourself, why I did it in such a nasty way and not doing something with formatting parameters {0} or string concatenation. The reason is simple. Today we still have a limitation of having 8192 characters for the rules definition - and the resulting XML if I would use a nicer code without this nasty escaping would just be too long.</p>
<p>Here some example output:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogDateTime.png"><img border="0" width="253" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben.WorkflowCloudbustingHiddencodelogicincon_5F00_103BF/WatchDogDateTime_5F00_thumb.png" alt="WatchDogDateTime" height="80" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Now, if we would not have that 8192 character limitation we could really do quite some nice tricks.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2854" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxCodename "Dublin" - Microsoft's Distributed Application Server/blogs/andreas_erben/archive/2008/09/17/codename-quot-dublin-quot-microsoft-s-distributed-application-server.aspx2008-09-17T18:01:44Z2008-09-17T18:01:44Z<p>(German version below / deutsche Version weiter unten)</p> <p>I did not find blog entries about this elsewhere, so here we go. Disclaimer: Nobody shared this information actively with me, and no confidential information was leaked to me, I happened to find it in public sources and derived my conclusion:</p> <p>It seems that Microsoft's SOA/BPM strategy has found another codename complementing "<a href="http://www.microsoft.com/soa/products/oslo.aspx">OSLO</a>". While OSLO focuses more on the integrated and system-wide modeling experience, the codename "<strong><u>DUBLIN</u></strong>" stands for the Distributed Application Server.</p> <p>Previously the Distributed Application Server was thought to be part of the "wave of OSLO related technologies". I conclude that this means that the product roadmap is maturing.</p> <p>Welcome new codename :)</p> <p> </p> <p>(German version/ Deutsche Version)</p> <p>Da ich sonst keine Blogeinträge hierüber gefunden habe. Diese Information wurde mir weder in irgendeiner Form aktiv zugetragen, und es wurde mir auch keine vertrauliche Information mitgeteilt, sondern ich habe dies aus öffentlich zugänglichen Quellen und dann meine eigenen Schlüsse gezogen:</p> <p>Es scheint, dass die SOA/BPM-Strategie von Microsoft einen neuen Codenamen gefunden hat, der "<a href="http://www.microsoft.com/soa/products/oslo.aspx">OSLO</a>" ergänzen soll. Während OSLO mehr auf die integrierte und systemweite Modellierungsbotschaft abzielt, steht der Codename "<strong><u>DUBLIN</u></strong>" für den Distributed Application Server.</p> <p>Vorher hat man über den Distributed Application Server meist nur als Teil der Welle der OSLO-relevanten Technologien gesprochen. Ich schließe daraus, dass die Produkt-Roadmap deutlich gereift ist.</p> <p>Willkommen neuer Codename :)</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2815" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxAndreas@Mobility Day 2008, Zagreb, Croatia/blogs/andreas_erben/archive/2008/09/13/andreas-mobility-day-2008-zagreb-croatia.aspx2008-09-13T01:10:24Z2008-09-13T01:10:24Z<p>I had the honor to present at the <a href="http://www.mobilitydays.com">Mobility Day 2008</a> in beautiful Zagreb, Croatia on September 9, 2008.</p> <p>I covered part 2 of a series of two sessions dealing with "best practices" about connecting mobile systems. While the first part, presented by <a href="http://developers.de/blogs/damir_dobric/default.aspx">Damir Dobric</a>, dealt with quite advanced connectivity scenarios utilizing WCF and .NET Compact Framework at the core implementation level, my part presented a larger scenario combining a WCF Service Bus and a retry-ing binding together with a cell tower to geo-coordinate service to a multiple-subscriber application.</p> <p>Find my presentation at this <a href="http://developers.de/media/p/2857.aspx">location</a>: <a title="http://developers.de/media/p/2857.aspx" href="http://developers.de/media/p/2857.aspx">http://developers.de/media/p/2857.aspx</a>.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2858" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxA flow control in the cloud / Flow control activities & BizTalk Workflow Services/blogs/andreas_erben/archive/2008/08/09/a-flow-control-in-the-cloud-flow-control-activities-amp-biztalk-workflow-services.aspx2008-08-09T01:49:25Z2008-08-09T01:49:25Z<p>(German version maybe coming later / deutsche Version folgt eventuell später)</p> <p>This post is a continuation of my <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">intro to BizTalk Workflow Services</a>.</p> <p>When orchestrating anything or in more simple words, when implementing an algorithm, we typically need a type of flow control. What is the order of the commands? How do we set conditions? How do we repeat something? This also is necessary when wanting to run an algorithm in the cloud. We are using BizTalk Workflow Services to describe what we want to do in the cloud. The tool we have are workflow activities.</p> <p><a href="https://workflow.biztalk.net/">BizTalk Workflow Services</a> have a limited set of flow control activities:</p> <ul> <li>CloudIfElse <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelse" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse_5F00_thumb.png" width="16" border="0" /></a> (and CloudIfElseBranch <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a>)</li> <li>CloudWhile <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.while" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while_5F00_thumb.png" width="16" border="0" /></a> </li> <li>CloudSequence <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.sequence" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence_5F00_thumb.png" width="16" border="0" /></a> </li></ul> <p>This does not seem much, but together with a place to store your data it theoretically lets people implement all types of algorithms.</p> <p>CloudIfElse <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelse" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse_5F00_thumb.png" width="16" border="0" /></a> (and CloudIfElseBranch <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a>) work very much like their regular equivalents. However, remember that those activities are in fact a new implementation and are not identical to IfElse or IfElseBranch.</p> <p>Practically you will have to remember when setting rules, that you can only use declarative rule conditions (stay tuned in some days for a post about declarative rule conditions). Trying to use a code condition in the CloudIfElseBranch <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a> will result in this:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/OnlyDeclaritiveRules_5F00_2.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="224" alt="OnlyDeclaritiveRules" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/OnlyDeclaritiveRules_5F00_thumb.png" width="644" border="0" /></a> </p> <p>The CloudIfElse <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelse" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelse_5F00_thumb.png" width="16" border="0" /></a> activity needs a minimum of one cloudIfElseBranches <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a> but can have more than 2:</p> <p>You can add a branch:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseAddBranch_5F00_2.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="506" alt="CloudIfElseAddBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseAddBranch_5F00_thumb.png" width="599" border="0" /></a> </p> <p>That branch will be always added to the right:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseAddedBranch_5F00_4.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="321" alt="CloudIfElseAddedBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseAddedBranch_5F00_thumb_5F00_1.png" width="576" border="0" /></a> </p> <p>Notice that now cloudIfElseBranch2 displays an error (exclamation mark in red circle) because we did not set a condition on the cloudIfElseBranch2 yet. The error did not display earlier, because the last CloudIfElseBranch <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a> in fact does not need a condition to be set. The CloudIfElseBranches' <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a> conditions are evaluated from the left to the right.</p> <p>If we do not like the position of a CloudIfElseBranch <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.ifelseBranch" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.ifelseBranch_5F00_thumb.png" width="16" border="0" /></a>, we can change their position with the help of the context menu easily:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseBranchMove_5F00_2.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="324" alt="CloudIfElseBranchMove" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseBranchMove_5F00_thumb.png" width="581" border="0" /></a> </p> <p>We move it to the left, so we expect the cloudIfElseBranch2 (and it's red exclamation mark circle) now to be on the very left side:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseBranchMoved_5F00_2.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="327" alt="CloudIfElseBranchMoved" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudIfElseBranchMoved_5F00_thumb.png" width="576" border="0" /></a> </p> <p> </p> <p>The CloudWhile <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.while" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while_5F00_thumb.png" width="16" border="0" /></a> activity is again the cloud version of the regular While branch. And this neat activity is at the same time the reason for the CloudSequence <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.sequence" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence_5F00_thumb.png" width="16" border="0" /></a> activity. The CloudWhile <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.while" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while_5F00_thumb.png" width="16" border="0" /></a> activity only allows one inner child activity to be repeated. So, what you need is a Sequence activity. However, currently you cannot use a non-cloud activity in a cloud-based workflow.</p> <p>Even though as we have seen in my previous <a href="http://developers.de/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx">post</a> the cloud-workflow itself is a SequenceActivity, it cannot contain a SequenceActivity but needs a CloudSequence <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.sequence" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.sequence_5F00_thumb.png" width="16" border="0" /></a> activity instead.</p> <p>Trying to use a non-cloud activity will result in the following validation error when trying to save the XOML in the web-form:</p> <blockquote> <p><font color="#ff0000">The workflow failed validation </font> <ul> <li><font color="#ff0000">Type System.Workflow.Activities.SequenceActivity, System.Workflow.Activities, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 is not marked as authorized in the application configuration file.</font></li></ul></blockquote> <p>This makes a CloudWhile <a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="16" alt="System.ServiceBus.Workflow.while" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/System.ServiceBus.Workflow.while_5F00_thumb.png" width="16" border="0" /></a> with more than one activity to look like this:</p> <p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudWhileWithSequence_5F00_2.png"><img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="388" alt="CloudWhileWithSequence" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/CloudWhileWithSequence_5F00_thumb.png" width="262" border="0" /></a> </p> <p>In one of the next posts I will look at the other activities and a bit deeper into the conditions you can use.</p> <p> </p> <p><em>A little "disclaimer": Some readers wondered why I explain very simple things here. My reasoning is that I expect completely new users to want to get started with cloud technologies without digging through the workflow foundation's fundamentals first. They will want to look at the workflow foundation's basics soon enough anyways. But it could be overwhelming for new readers and people interested in BizTalk Services to have to know too much before getting started. I aim at giving people an easier start.</em></p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2632" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxClouding the flow of work / BizTalk Workflow Services Intro/blogs/andreas_erben/archive/2008/08/05/clouding-the-flow-of-work-biztalk-workflow-services-intro.aspx2008-08-05T10:44:00Z2008-08-05T10:44:00Z<p>(German version maybe coming later / deutsche Version folgt eventuell später)</p>
<p><a href="http://workflow.biztalk.net">http://workflow.biztalk.net</a> now offers a CTP of BizTalk Workflow Services. Let's look at what that means.</p>
<p>First you should download the latest version of the SDK. Right now this is the file "<i>BizTalk Services SDK Setup 0.12.185.2.exe</i>". Please note that the availability of this site and all sub-sites of biztalk.net is at present not reliable at all. It can be taken down temporarily or even for extended periods of time. Please note that the information in this article is based on a very early pre-release version of something that might become a product. So, by the time you read it, <b><span style="text-decoration:underline;">this information may be outdated and plainly wrong</span></b>.</p>
<p>If you do not have an account for BizTalk Services yet, now is the time to create one. Vista users, I recommend creating an information card. When setting a username/password. I also recommend not setting a password that you really want to be secure. Reason: There will be things like deployment samples where the password will be visible.</p>
<p>Assuming you did that, let's look at the SDK:</p>
<p>To actually see what is happening in the samples, you have to start another sample in<br /><i>Program Files\Microsoft BizTalk Services SDK\Samples\Communication\ExploringFeatures\ConnectionModes\Multicast</i>. This is the place where you will receive a friendly "Hello" from your workflow via the Internet Service Bus (ISB). Use "watchdog" as your chat session name.</p>
<p>In <i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\GettingStarted</i>, you can find a definition of a simple "Cloud" Workflow together with rules.</p>
<p>To get started really quickly, you can look at </p>
<p><i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\ExploringFeatures\CreateWorkflowAPIs</i>.</p>
<p>This sample will, when you start it, ask for your credentials and upload a simple workflow to your BizTalk Services account.</p>
<p>I was a little paranoid, so I blanked out the password (now you know why you should not use a relevant password that you use elsewhere, since you might show this sample to someone and bang - there goes your password) and even the authentication token (even though the latter should not really be necessary... but you never know :) ). When doing that, leave it running for a bit before doing "Press any key to terminate workflow instance".</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAPICreateWorkflowOutput01_5F00_1.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAPICreateWorkflowOutput01_5F00_thumb_5F00_1.png" alt="BizTalkServicesWorkflowAPICreateWorkflowOutput01" height="167" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>What should happen? Your workflow will start and will try to send a HTTP request to <a href="http://www.microsoft.com">http://www.microsoft.com</a>. If the HTTP-request status is less than 400, then it will send a message to the ISB (to "your" session) that it can reach the Microsoft website. If the site is not responding, then you will receive this information via ISB. The workflow will repeat this procedure every 30 seconds.</p>
<p>Look at the output of your MulticastSample:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowMultiCastOutput01_5F00_1.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowMultiCastOutput01_5F00_thumb_5F00_1.png" alt="BizTalkServicesWorkflowMultiCastOutput01" height="324" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>(Again, paranoid me did not want to disclose the chat-name right now)</p>
<p> </p>
<p>When setting it up, you should see something like that:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFTypeManagement01.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFTypeManagement01_5F00_thumb.png" alt="BizTalkServicesWFTypeManagement01" height="484" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>You can also create / edit your workflows online without using Visual Studio. No designer support though right now. So, let's edit this. First click on the line with the name of your workflow type ("mywatchdog" in this case). It will be marked in the browser and then click on "Edit".</p>
<p>(Note that "Add New" is not much different other than that you have to also specify a name for your new workflow type)</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFTypeManagement02.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFTypeManagement02_5F00_thumb.png" alt="BizTalkServicesWFTypeManagement02" height="643" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>You see that only two tabs are present: Xoml and Rules. This means that the only thing that is uploaded are the XAML (.xoml) and including the rules definitions of your workflow. With other words - no code-behind/developer defined partial C# classes!</p>
<p>Typically you would just copy/paste your relevant XAML (XOML) and rules here.</p>
<p>In "Type Management" you can also "Create Instances". Doing that will add an instance to the "Manage Instance" page:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFInstanceManagement01.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWFInstanceManagement01_5F00_thumb.png" alt="BizTalkServicesWFInstanceManagement01" height="489" style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" /></a> </p>
<p>You could start an instance (if it is in a startable state) by selecting it and then clicking "<i>Start</i>". Note that when you see an instance that displays "Terminated" and the termination was because of an exception, then you can actually click on the link behind the word "Terminated" to get the top-level exception that caused the Workflow to terminate.</p>
<p>But what can you actually do with the Workflow Services right now? Remember, you are running them in the "cloud". And if you could do just anything, this could result in the whole platform getting vulnerable. So what Microsoft did was, to limit the types of activities you can run in the "cloud".</p>
<p>Right now those activities are:</p>
<ul>
<li>CloudDelay </li>
<li>CloudHttpReceive </li>
<li>CloudHttpSend </li>
<li>CloudIfElse (and CloudIfElseBranch) </li>
<li>CloudSequence </li>
<li>CloudServiceBusSend </li>
<li>CloudWhile</li>
</ul>
<p>This is a severely limiting subset of Workflow activities.</p>
<p>If you do not limit yourself to those activities, e.g. by adding something like</p>
<p style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;"> <span style="color:#0000ff;"><</span><span style="color:#a31515;">DelayActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">TimeoutDuration</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">00:00:00</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">delayActivity1</span>"<span style="color:#0000ff;"> /></span></p>
<p>to your XOML, you will get "<span style="color:#ff0000;"><b>The workflow failed validation</b></span>" when trying to save your changes.´</p>
<p>Now let's look at the workflow again in Visual Studio. I use Visual Studio 2008, the samples are made for Visual Studio 2005 with the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=5D61409E-1FA3-48CF-8023-E8F38E709BA6&displaylang=en">Visual Studio 2005 Extensions for .Net Framework 3.0 (Windows Workflow Foundation)</a>.</p>
<p>We are working with <i>Program Files\Microsoft BizTalk Services SDK\Samples\Workflow\GettingStarted </i>now again.</p>
<p>Your workflow should look like this:</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowGettingStarted01_5F00_2.png"><img border="0" width="483" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowGettingStarted01_5F00_thumb.png" alt="BizTalkServicesWorkflowGettingStarted01" height="721" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Open in the Menu <i>Tools / Choose Toolbox Items... </i>or select <i>Choose Items...</i> directly in the context-menu when right-clicking in the toolbox. In this window go to the tab "<i>Activities</i>".</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox01_5F00_2.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox01_5F00_thumb.png" alt="BizTalkServicesWorkflowAddToToolbox01" height="434" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>The click "<i><span style="text-decoration:underline;">B</span>rowse...</i>" and select the DLL "System.ServiceBus.Workflow.dll" in <i>Program Files\Microsoft BizTalk Services SDK\Assemblies </i>and choose "<i>OK</i>".</p>
<p>You should see something like that.</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox02_5F00_2.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox02_5F00_thumb.png" alt="BizTalkServicesWorkflowAddToToolbox02" height="434" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Select "OK" again and your toolbox should see some new activities at the bottom of the list.</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox03_5F00_2.png"><img border="0" width="226" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowAddToToolbox03_5F00_thumb.png" alt="BizTalkServicesWorkflowAddToToolbox03" height="881" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>And your project should look similar to this.</p>
<p align="center"><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowGettingStarted02_5F00_2.png"><img border="0" width="634" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/BizTalkServicesWorkflowGettingStarted02_5F00_thumb.png" alt="BizTalkServicesWorkflowGettingStarted02" height="547" style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" /></a> </p>
<p>Now you are basically ready to build your own cloud-hosted workflows.</p>
<p>I think it is worth noting, that the workflow is at the root-level still a regular SequentialWorkflowActivity as seen in the code (which is however not used in the cloud but still it is still there in the project file. Do not put logic here. :) ):</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">partial</span> <span style="color:#0000ff;">class</span> <span style="color:#2b91af;">Workflow1</span> : <span style="color:#2b91af;">SequentialWorkflowActivity</span></p>
<p style="margin:0px;">{</p>
<p style="margin:0px;">}</p>
</div>
<p>and more importantly in the root node of the XAML:</p>
<div style="font-size:10pt;background:#ffffc0;color:black;font-family:courier new;">
<p style="margin:0px;"><span style="color:#0000ff;"><</span><span style="color:#a31515;">SequentialWorkflowActivity</span><span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Class</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">WorkflowProject1.Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">Workflow1</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:ns0</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">clr-namespace:System.ServiceBus.Workflow;Assembly=System.ServiceBus.Workflow, Version=0.12.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns:x</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml</span>"<span style="color:#0000ff;"> </span><span style="color:#ff0000;">xmlns</span><span style="color:#0000ff;">=</span>"<span style="color:#0000ff;">http://schemas.microsoft.com/winfx/2006/xaml/workflow</span>"<span style="color:#0000ff;">></span></p>
</div>
<p>When looking at the rules, you will further notice that the rules have nothing cloud-specific besides of accessing the cloud-specific activities.</p>
<p> </p>
<p>The next posts will look closer at the new activities and at some of the inner workings of the samples, we will further try to stretch what can be done.</p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2619" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspxCUIL.COM doesn't rank itself highest / CUIL.COM taucht im eigenen Ranking nicht ganz oben auf/blogs/andreas_erben/archive/2008/07/29/cuil-com-doesn-t-rank-itself-highest-cuil-com-taucht-im-eigenen-ranking-nicht-ganz-oben-auf.aspx2008-07-29T09:43:43Z2008-07-29T09:43:43Z<p>(German version below / deutsche Version weiter unten)</p> <p>CUIL.COM, founded by former GOOGLE employees, was just launched to the public yesterday. I was interested in finding out how CUIL ranks itself.</p> <p>Here are the results and a comparison to what GOOGLE has to say to the same query. You will see that CUIL right now is still honest about its relevance at this point in time.</p> <p> </p> <p> </p> <p>(German version / deutsche Version)</p> <p>CUIL.COM, gegründet von ehemaligen GOOGLE Angestellten, wurde gestern der breiteren Öffentlichkeit vorgestellt. Ich fand es interessant, herauszufinden, wie sich CUIL zu diesem Zeitpunkt selbst "ranken" würde.</p> <p>Hier sind die Ergebnisse und der Vergleich, was GOOGLE zur jeweils gleichen Anfrage zu sagen hat. Man sieht gut, dass CUIL im Moment noch ehrlich ist, was die eigene Relevanz zu diesem Zeitpunkt betrifft.</p> <p> </p> <p>CUIL.COM - CUIL:</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_6.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="772" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_thumb_5F00_2.png" width="524" border="0" /></a> </p> <p>GOOGLE.COM - CUIL:<br /><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_12.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="772" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_thumb_5F00_5.png" width="523" border="0" /></a> </p> <p>CUIL.COM - CUIL.COM:</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_10.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="772" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_thumb_5F00_4.png" width="522" border="0" /></a> </p> <p>GOOGLE.COM - CUIL:</p> <p><a href="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_8.png"><img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="772" alt="image" src="http://developers.de/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/andreas_5F00_erben/image_5F00_thumb_5F00_3.png" width="523" border="0" /></a></p><div style="clear:both;"></div><img src="http://developers.de/aggbug.aspx?PostID=2556" width="1" height="1">aerbenhttp://developers.de/members/aerben/default.aspx