WCF 4 http://rickgaribay.net/category/35.aspx WCF 4 en-US Rick G. Garibay rickgaribay@hotmail.com Subtext Version 1.9.5.176 Windows Server AppFabric Cookbook Giveaways http://rickgaribay.net/archive/2012/10/09/windows-server-appfabric-cookbook-giveaways.aspx <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/Windows-Server-AppFabric-Cookbook-Giveaw_BD3E/image_2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/Windows-Server-AppFabric-Cookbook-Giveaw_BD3E/image_thumb.png" width="95" height="116" /></a>My friend, and fellow <a href="https://mvp.support.microsoft.com/profile=CDD45B0A-BB05-44F2-A674-B7874CA4D185" target="_blank">Microsoft Integration MVP</a> <a href="twitter.com/@steefjan" target="_blank">Steef-Jan Wiggers</a> has been kind enough to organize a giveaway for my new book <a href="http://www.packtpub.com/microsoft-windows-server-appfabric-cookbook/book" target="_blank">Windows Server AppFabric Cookbook</a>.<a href="http://www.packtpub.com/"><img style="display: inline; float: right" align="right" src="http://www.emanueleferonato.com/wp-content/uploads/2010/09/packt.png" width="115" height="64" /></a></p> <p>You can learn more details about the contest on his blog: <a title="http://soa-thoughts.blogspot.nl/2012/10/microsoft-windows-server-appfabric.html" href="http://soa-thoughts.blogspot.nl/2012/10/microsoft-windows-server-appfabric.html">http://soa-thoughts.blogspot.nl/2012/10/microsoft-windows-server-appfabric.html</a></p> <p>In addition, I’m happy to announce that <a href="http://neudesic.com" target="_blank">Neudesic</a> has teamed up with <a href="http://www.packtpub.com/">Packt Publishing</a> to give away one e-book each week from 10/22 – 11/12 for a total of 3 winners. Be sure to follow <a href="http://twitter.com/neudesic" target="_blank">Neudesic</a> on twitter and stay tuned for rules and regulations beginning on Monday, October 15th. </p> <p>As I shared in <a href="http://rickgaribay.net/archive/2012/07/26/windows-server-appfabric-cookbook-is-out.aspx">my thoughts</a> when I announced the first run of the book, our goal with this book was not to promote the latest shiny object but instead to apply nearly two years of experience into a concise reference that could benefit organizations and the community tasks with building lightweight integration solutions on-premise today. As such, my hope is that what you will find is a <a href="http://neudesic.com"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="neudesic" border="0" alt="neudesic" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/Windows-Server-AppFabric-Cookbook-Giveaw_BD3E/neudesic_6.jpg" width="160" height="70" /></a>trusty field guide rich with simple to follow guidance for enhancing your career as a WCF and WF developer, architect or administrator. </p> <p>I’d like to thank Steef-Jan and the community for the overwhelmingly positive response to the book so far. Hammad and I worked very hard for nearly a year on this project and it is incredibly rewarding to see praise from world renowned thought leaders in the integration space like Steef-Jan, <a href="http://seroter.wordpress.com/2012/09/14/book-review-microsoft-windows-server-appfabric-cookbook/" target="_blank">Richard Seroter</a> and others who have been very kind in validating our efforts.</p> <p>You can learn more about the book on <a href="http://www.packtpub.com/microsoft-windows-server-appfabric-cookbook/book" target="_blank">Packt’s website</a> or <a href="http://www.amazon.com/Microsoft-Windows-Server-AppFabric-Cookbook/dp/1849684189/ref=sr_1_1?ie=UTF8&amp;qid=1349814924&amp;sr=8-1&amp;keywords=windows+server+appfabric+cookbook" target="_blank">Amazon.com</a>.</p><img src="http://rickgaribay.net/aggbug/346.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2012/10/09/windows-server-appfabric-cookbook-giveaways.aspx Tue, 09 Oct 2012 21:03:57 GMT http://rickgaribay.net/archive/2012/10/09/windows-server-appfabric-cookbook-giveaways.aspx#feedback http://rickgaribay.net/comments/commentRss/346.aspx http://rickgaribay.net/services/trackbacks/346.aspx NuCon 2012&ndash;Feb 16th, Irvine, CA http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx <p>I’d like to pass on some details regarding an event I will be speaking on in Irvine, CA on February 16th.</p> <p><a href="http://www.neudesic.com/nucon/" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top: 0px; border-right: 0px; padding-top: 0px" title="NU_logo" border="0" alt="NU_logo" align="left" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/NU_logo.png" width="158" height="105" /></a>NuCon is a one day conference put on by my employer, <a href="http://neudesic.com" target="_blank">Neudesic</a> that features talks and content from fellow Neudesic colleagues like <a href="https://twitter.com/#!/davidpallmann" target="_blank">David Pallmann</a>, <a href="https://twitter.com/#!/tedneward" target="_blank">Ted Neward</a> and <a href="https://twitter.com/#!/simonguest" target="_blank">Simon Guest</a>, <a href="http://www.neudesic.com/nucon/speakers.html" target="_blank">just to name a few</a>. <a href="http://www.neudesic.com/nucon/" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image.png" width="485" height="1043" /></a></p> <p>As Irvine is Neudesic’s headquarters, the event provides a great opportunity to gain insight into the future of technology as seen by my fellow colleagues as well as providing pragmatic guidance that you can put to use the following day while networking with other Neudesic customers,  executive management, partners and thought leaders to help guide your strategy on making the most of the tremendous opportunities that the Microsoft platform and Neudesic products have to offer.</p> <p>In my talk, <a href="http://www.neudesic.com/nucon/schedule.html" target="_blank">Hybrid Composition on the Microsoft Application Integration platform</a>, I’ll share how organizations of all shapes and sizes can benefit from the improvement, automation and streamlining of their business operations through hybrid composition.</p> <p><strong><em>Abstract</em></strong> <a href="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image_3.png"><img style="background-image: none; border-right-width: 0px; margin: 10px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/Images/customcontent/Announcing-NuCon-2012_A361/image_thumb.png" width="207" height="344" /></a></p> <p>In today’s technology landscape, exposing key functional areas as traditional services or other means has become the norm for achieving agility and is a requirement for taking advantage of the dramatic improvements that modern middleware capabilities both on-premise and in the cloud provide. </p> <p>As organizations adapt to this new hybrid model, a shift from a homogenous, single product, big iron approach to heterogeneous, best in class, capability-driven model is necessary for realizing the benefits of service-orientation and enabling the composition of these services on-premise, in the cloud and behind the firewall without making big spending commitments on a product that may only meet some of these needs.</p> <p>The Microsoft platform offers a number of capabilities for achieving these goals across common Hosting, Workflow, Rules, EAI and Messaging workloads that allow you to choose the right capabilities for delivering your intended business outcomes.</p> <p>BizTalk Server 2010 and Windows Server AppFabric 1.1 provide a comprehensive middleware platform for developing, deploying, and managing composite enterprise capabilities on-premise and Windows Azure Service Bus and Access Control Service allow you to extend your investments beyond traditional trust and network boundaries making the cloud and other partner/vendor endpoints merely an extension of your enterprise. </p> <p>Come learn how Windows Server AppFabric, WCF, WF Services, BizTalk Server and Windows Azure can benefit your approach to building and supporting application services at enterprise scale while transcending traditional trust boundaries and enabling the hybrid enterprise.</p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em></em></p> <p><em>To give you an idea of the breadth and depth of the sessions, in my talk, I’ll be talking about and showing live demos of the latest capabilities that enable you to build hybrid composite solutions to drive differentiation and innovation within your organization:</em></p> <p><strong>Windows Server AppFabric 1.1 Caching (On-Prem) Featuring:</strong></p> <ul> <li>AppFabric distributed caching including implementing the Cache-Aside caching pattern and Read-Through caching, new in AppFabric 1.1  </li> </ul> <p><strong>WF 4 Workflow Services (On-Prem) Featuring:</strong></p> <ul> <li>State Machine Activity, new in .NET 4.1 and .NET 4.5  </li> <li>AppFabric Connect BizTalk Mapper for WF 4 in AppFabric Connect </li> <li>Long-running workflows </li> <li>Workflow Correlation </li> <li>Composition with WCF services in Windows Azure <br /></li> </ul> <p><strong>Windows Server AppFabric Deployment (On-Prem) Featuring:</strong></p> <ul> <li>Easy deployment with Microsoft Web Deploy </li> <li>Windows Server AppFabric Configuration Experience </li> </ul> <p><strong>WCF hosting in Windows Azure Web Roles (Cloud) Featuring:</strong></p> <ul> <li>Azure Web Role hosting </li> <li>Azure Service Bus Topic client </li> </ul> <p><strong>Azure Service Bus Brokered Messaging (Hybrid) Featuring:</strong></p> <ul> <li>Brokered messaging from Azure to on-premise custom applications behind the firewall </li> <li>Topics and Subscriptions </li> </ul> <p><strong>BizTalk Server 2010 Orchestration &amp; Messaging (On-Prem) Featuring:</strong></p> <ul> <li>Custom WCF Adapter for consuming messages off an Azure Service Bus Topic </li> <li>Support for custom WCF behaviors </li> <li>Support for hybrid ERP integration such as Dynamics CRM or SAP </li> </ul> <p>So, if you are interested in attending, please consider yourself invited! Click on the links in the invitation below to register (save $100 if you register before Feb 1) and I look forward to seeing you at NuCon 12!</p><img src="http://rickgaribay.net/aggbug/325.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx Mon, 16 Jan 2012 19:44:34 GMT http://rickgaribay.net/archive/2012/01/16/nucon-2012ndashfeb-16th-irvine-ca.aspx#feedback http://rickgaribay.net/comments/commentRss/325.aspx http://rickgaribay.net/services/trackbacks/325.aspx DCC 2011.2 Lap Around Azure Service Bus: The Goods http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx <p>Thanks to all that came out to my “<a href="http://nov2011.desertcodecamp.com/session/430" target="_blank">Lap Around Azure Service Bus Brokered Messaging</a>” talk at Desert Code Camp today. </p> <p>We covered a ton of content including things a few folks didn’t know about relay messaging capabilities in Azure Service Bus and demonstrated how simple it is to expose a REST or SOAP endpoint from behind the firewall. I also demonstrated the brand new load balancing capabilities that were just released last week. </p> <p>From there, we dove deep into the .NET API to walk through how to provision queues and topics from code and start messaging within minutes by simply grabbing the Azure Service Bus NuGet package and writing a few lines of code.<iframe height="327" src="http://r.office.microsoft.com/r/rlidPowerPointEmbed?p1=1&amp;p2=1&amp;p3=SDDF930EE6F91132FD!422&amp;p4=&amp;kip=1" frameborder="0" width="402" scrolling="no" align="right"></iframe></p> <p>Next, we explored the REST API, and how simple it is for any HTTP client, regardless of platform to take advantage of the robust messaging capabilities that Azure Service Bus queues and topics have to offer.</p> <p>Last but not least, we wrapped up with a quick walkthrough of the NeMessagingBinding and how simple it is to send and receive messages over a queue using the familiar WCF programming model.</p> <p>I hope that each of you will unlock new possibilities with the power that these hybrid messaging capabilities have to offer. </p> <p>I’d also like to thank <a href="http://www.pluralsight-training.net/microsoft/" target="_blank">Pluralsight</a> for sponsoring my session. The <a href="http://twitter.com/#!/search/realtime/%23dcc11%20%23Azure%20%23ServiceBus%20%23Q1" target="_blank">quiz is now up</a> for the first 5 smartest attendees. </p> <p>Search for hashtags <a href="http://twitter.com/#!/search/realtime/%23dcc11%20%23Azure%20%23ServiceBus%20%23Q2" target="_blank">#dcc11 #Azure #ServiceBus #Q1 to #Q5.</a></p> <p>Good Luck! </p> <p> </p> <table border="0" cellspacing="0" cellpadding="2" width="229"><tbody> <tr> <td valign="middle" width="91"><strong>Code Demos</strong></td> <td valign="middle" width="136"><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; width: 98px; padding-right: 0px; height: 115px; padding-top: 0px" title="Preview" marginheight="0" src="https://skydrive.live.com/embedicon.aspx/Public/Talks/DCC%202011.2?cid=df930ee6f91132fd&amp;sc=documents" frameborder="0" marginwidth="0" scrolling="no" align="right"></iframe></td> </tr> </tbody></table> <p> </p> <p>Happy Messaging!</p><img src="http://rickgaribay.net/aggbug/323.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx Sat, 05 Nov 2011 21:33:25 GMT http://rickgaribay.net/archive/2011/11/05/dcc-2011.2-lap-around-azure-service-bus-the-goods.aspx#feedback http://rickgaribay.net/comments/commentRss/323.aspx http://rickgaribay.net/services/trackbacks/323.aspx New Article in CODE Magazine on Azure Service Bus Queues &amp; Topics http://rickgaribay.net/archive/2011/10/26/new-article-in-code-magazine-on-azure-service-bus-queues.aspx <p>I am pleased to share that my new article on <a href="http://www.code-magazine.com/article.aspx?quickid=1112041">Azure Service Bus Queues and Topics</a> has just been published by <a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay">CODE Magazine</a>.</p> <p>CODE Magazine is a leading Microsoft technical journal with a worldwide in-print circulation in excess of 20,000 along with on-line, <a href="http://www.xiine.com/">Xiine</a> and <a href="http://www.amazon.com/CODE-Magazine-2011-Nov-ebook/dp/B005XN7RFA/ref=sr_1_8?s=digital-text&amp;ie=UTF8&amp;qid=1319558915&amp;sr=1-8">Amazon Kindle</a> media distribution. CODE is distributed to a combination of paid subscriptions, quali<a target="_blank" href="http://www.code-magazine.com/Index.aspx"><img style="BACKGROUND-IMAGE: none; BORDER-RIGHT-WIDTH: 0px; MARGIN: 2px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: right; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; PADDING-TOP: 0px" title="image" border="0" alt="image" align="right" width="164" height="210" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/New-Article-on-Azure-Service-Bus-Queues-_866B/image_3.png" /></a>fied requests, and newsstand sales. In addition, CODE Magazine has bonus distribution at targeted Microsoft-oriented conferences and targeted industry events throughout the year such as Microsoft Professional Developer Conference (PDC), Tech Ed, DevTeach, MVP Global Summit, DevConnections, Devscovery, QCon, Code Camps, and more!</p> <p>Here is the link to the article: <a href="http://www.code-magazine.com/article.aspx?quickid=1112041">http://www.code-magazine.com/article.aspx?quickid=1112041</a></p> <p>The article covers critical capabilities provided by Azure Service Bus for composing distributed messaging solutions for the hybrid enterprise and how the latest release delivers on the Software + Services vision that was first laid out over five years ago. </p> <p>The new release includes the addition of Queues and Topics which build on top of an already robust set of capabilities introducing new levels of reliability for building loosely coupled distributed solutions across a variety of clients and services, be they on-premise, in the cloud, or a combination of the two.</p> <p>There are many exciting changes happening within Microsoft around integration and middleware, and the release of Service Bus Brokered Messaging/Queues and Topics is a strong reflection of the commitment to the platform that I believe is going to make this new wave of innovation more exciting than ever before.</p> <p>It has been a tremendous privilege to have the opportunity to work with the Azure Service Bus team and experiment with the early bits ahead of release. I’d like to thank Todd Holmquist-Sutherland, <a target="_blank" href="http://twitter.com/clemensv">Clemens Vasters</a>, <a target="_blank" href="http://twitter.com/@AbhishekRLal">Abhishek Lal</a> and <a target="_blank" href="http://twitter.com/@dingha">David Ingham</a> for the unprecedented access to their team, resources and information as well as kindly and patiently answering my many questions over the last several weeks.</p> <p>Long live messaging!</p><img src="http://rickgaribay.net/aggbug/320.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/10/26/new-article-in-code-magazine-on-azure-service-bus-queues.aspx Wed, 26 Oct 2011 17:20:03 GMT http://rickgaribay.net/archive/2011/10/26/new-article-in-code-magazine-on-azure-service-bus-queues.aspx#feedback http://rickgaribay.net/comments/commentRss/320.aspx http://rickgaribay.net/services/trackbacks/320.aspx Getting the Most out of WCF 4.0 REST Today http://rickgaribay.net/archive/2011/10/20/getting-the-most-out-of-wcf-4.0-rest-today-again.aspx <p>WCF has supported HTTP and RESTful approaches to service design for some time now, and while there are some exciting new enhancements being worked on as part of the <a href="http://wcf.codeplex.com/" target="_blank">WCF Web API project</a>, there is some pretty rich functionality in WCF 4.0 that is definitely worth taking advantage of if you need to build HTTP/REST services today, especially when hosting in Windows Server AppFabric. <a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/4187_04_25_4.png"><img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="4187_04_25" border="0" alt="4187_04_25" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/4187_04_25_thumb_1.png" width="240" height="131" /></a></p> <p>There a number of differences to consider when working with REST services that require some special attention as compared to traditional SOAP services, and those differences are definitely noticeable when working with WCF. In this post, I’d like to highlight some of the most common capabilities that REST developers ask for and how to accomplish them in general and when hosting in IIS or Windows Server AppFabric. The WCF Web API improves upon some of the techniques I cover here and introduces new ones which I’ll be discussing in future posts. </p> <p>The first thing you want to do when working with WCF REST is pick a project template. While WCF 4 supports REST out-of-the-box (including a number of improvements over previous versions and the alignment of out-of-band features first seen in the WCF Starter Kit), the default WCF templates are really designed for SOAP-based services and thus are rather lacking for supporting REST an an intuitive, F5 manner (again, this will get better). </p> <p>Microsoft provides the <a href="http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd" target="_blank">WCF REST Service Application template</a>  via the Visual Studio 2010 Extension Manager. In addition to some useful scaffolding for providing an F5 experience, some fundamental code and configuration is provided as part of the template which is necessary for working with a host such as IIS or Windows Server AppFabric. <a href="http://twitter.com/ronljacobs" target="_blank">Ron Jacobs</a> also has a great template specifically designed for Server AppFabric that extends the functionality in this template to support end to end monitoring and provides a web-based test harness among other things. I definitely recommend that you <a href="http://visualstudiogallery.msdn.microsoft.com/a685f193-ed1e-4ad4-938f-f0bd8212d53d" target="_blank">check it out as well</a>. </p> <p>To keep things focused on the basic aspects of WCF REST 4.0, I’ve taken the <a href="http://visualstudiogallery.msdn.microsoft.com/fbc7e5c1-a0d2-41bd-9d7b-e54c845394cd" target="_blank">WCF REST Service Application template</a> with very minor modifications and created a simple read-only GET service to illustrate some of the most common things you’re likely to hit when starting out with REST in WCF 4. </p> <p>Out of the box, the WCF REST Service Application template provides some basic scaffolding including a functional read-only (GET) REST service. While “SampleItem” is certainly not the most interesting domain, I am going to leave the sample unaltered for simplicity sake as we are going to focus more on the hosting aspects of WCF REST than the design and the code.  </p> <p>Once you create a project with the WCF REST Service Application template, there are 4 files that are created in the project:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_16.png"><img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_7.png" width="192" height="175" /></a></p> <ul> <li>The Service1.cs file includes the definition and implementation of the service. </li> <li>The SampleItem.cs file includes the Data Contract that models a resource. </li> <li>The Global.asax file defines some key events that we’ll hook into to enable dynamic routing. </li> <li>The Web.config file includes some key configuration for enabling dynamic routing and supporting extension-less (svc-less) URIs among other things. </li> </ul> <p>The first thing you’ll probably notice in the template is that its missing an .svc file. Most REST developers would rather work with clean URIs as opposed to having a file extension get in the way. Fortunately, with a little bit of help from ASP.NET, we can leverage some pretty sophisticated routing capabilities that not only allow us to eliminate the need for the .svc extension, but in addition enable us to factor our URIs across a number of services and have some pretty fine grained control over URI routes using a templated approach.</p> <p>If you hit F5 at this point, the service will run in Cassini, generating a rather glum response (note that you may not see XML immediately depending on the browser you are using; a brute force approach is to view source or, in the case of IE9, which I am using here, leverage the browser targeting capabilities provided by the F12 developer tools):</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_18.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_8.png" width="1187" height="229" /></a></p> <p> </p> <p>If you take a look inside the Global.asax.cs files, you’ll see what makes this magic happen:</p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: RouteTable.Routes.Add(<span style="color: #0000ff">new</span> ServiceRoute("Service1<span style="color: #8b0000"></span>", <span style="color: #0000ff">new</span> WebServiceHostFactory(), <span style="color: #0000ff">typeof</span>(Service1))); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: </pre></pre> <p> </p> <p>As shown above, the template automatically added an entry to the System.Web.Routing.RouteTable. The Add method takes a ServiceRoute instance for which we provide 3 parameters:</p> <ul> <li>The first parameter is known as a route prefix and signals the root path that will be mapped to a given WCF service type. In this case, the URI segment of “Service1” will route to the Service1 class as specified in the third parameter. </li> <li>The second parameter is also interesting. Unlike traditional SOAP services that use a ServiceHost, the WebServiceHostFactory was designed to deal with HTTP-based services exclusively. </li> </ul> <p>This default code can immediately be improved upon in my opinion by replacing the route prefix with a simple empty string. This will invoke the GetCollection method in the service implementation which provides a nice, intuitive user experience when interacting with the service without knowing much about it.</p> <p>Taking a look at the service class and the GetCollection method, you will see some familiar attributes, along with the AspNetCompatabilityRequirements attribute which, among other things enables support for routing:</p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: [ServiceContract] </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)] </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Service1 </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: { </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: [WebGet(UriTemplate = "<span style="color: #8b0000"></span>")] </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: <span style="color: #0000ff">public</span> List&lt;SampleItem&gt; GetCollection() </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: <span style="color: #008000">// TODO: Replace the current implementation to return a collection of SampleItem instances</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> List&lt;SampleItem&gt;() { <span style="color: #0000ff">new</span> SampleItem() { Id = 1, StringValue = "<span style="color: #8b0000">Hello</span>" } }; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: } </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: }</pre></pre> <p> </p> <p>All of this also requires that ASP.NET compatibility is enabled declaratively in the Web.config by setting the aspNetCompatibilityEnabled attribute to true in the serviceHostingEnvironment element:</p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: &lt;system.serviceModel&gt; </pre><pre style="background-color: #ffff00; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="<span style="color: #8b0000">true</span>"/&gt; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: &lt;standardEndpoints&gt; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: &lt;webHttpEndpoint&gt; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: &lt;standardEndpoint name="<span style="color: #8b0000"></span>" helpEnabled="<span style="color: #8b0000">true</span>" automaticFormatSelectionEnabled="<span style="color: #8b0000">true</span>"/&gt; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: &lt;/webHttpEndpoint&gt; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: &lt;/standardEndpoints&gt; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: &lt;/system.serviceModel&gt;</pre></pre> <p> </p> <p>You will also notice that the web.config is absent of the boilerplate service and endpoint configuration including the address, binding and contract attributes. WCF 4 introduces the concept of default endpoints to simplify the approach for hosting services in WCF 4, which in effect automates the creation of common endpoint configurations for getting your WCF services up and running quickly and easily. Standard Endpoints build on this simplicity by providing common configurations packaged into an element and exercising convention over configuration. By using the WebHttpEndpoint standard endpoint, you are provided some common configuration knobs such as supporting multiple encoding types and help documentation that is automatically generated provided you enable the helpEnabled attribute in line 5 above:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_26.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_12.png" width="640" height="340" /></a></p> <p>While all of this works just fine in Cassini, it won’t work in IIS/Windows Server AppFabric as without the additional configuration I am going to cover next because it (rightfully) assumes that you are asking to browse the contents of the root directory which is fortunately forbidden unless you explicitly allow it:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_20.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_9.png" width="640" height="399" /></a></p> <p>Note that had I left the route prefix with the default “Service1”, a 404 would instead be thrown because without the correct modules, IIS has no way of routing this to the class by the same name.</p> <p>The remedy to these problems is provided by setting the runAllManagedModulesForAllRequests attribute in the modules element to true, which ensures that any requests that come into the request pipeline that are not mapped to an extension are passed on to the modules in the pipeline for processing. Specifically, the  route that was added to the Application_Start method implementation in the Global class will be used to resolve to the Service1 class by the UrlRoutingModule managed module which is registered using the configuration below and enables this routing for services that do not use the .svc extension and are hosted in IIS/Windows Server AppFabric: </p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #0000ff">&lt;</span><span style="color: #800000">system.webServer</span><span style="color: #0000ff">&gt;</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #0000ff">&lt;</span><span style="color: #800000">modules</span> <span style="color: #ff0000">runAllManagedModulesForAllRequests</span>=<span style="color: #0000ff">"true"</span><span style="color: #0000ff">&gt;</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: <span style="color: #0000ff">&lt;</span><span style="color: #800000">add</span> <span style="color: #ff0000">name</span>=<span style="color: #0000ff">"UrlRoutingModule"</span> <span style="color: #ff0000">type</span>=<span style="color: #0000ff">"System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"</span> <span style="color: #0000ff">/&gt;</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: <span style="color: #0000ff">&lt;/</span><span style="color: #800000">modules</span><span style="color: #0000ff">&gt;</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: <span style="color: #0000ff">&lt;/</span><span style="color: #800000">system.webServer</span><span style="color: #0000ff">&gt;</span></pre></pre> <p>It is possible, depending on your IIS configuration that the UrlRoutingModule has already been registered, in which case line 3 above is superfluous. If you comment it out and re-deploy, things will continue to work as expected unless you either remove it declaratively in the web.config or explicitly remove it from the Modules manager.</p> <p>With this configuration in place, the service will result in the request being correctly routed and the response presented in the browser:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_22.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_10.png" width="640" height="397" /></a></p> <p>If you’re like me, you likely find the XML, or at least the root node abhorrent. We can improve upon this significantly by creating a second class to represent the SampleItem that inherits from the original List&lt;SampleItem&gt; found in the template and decorate it with a CollectionDataContract attribute. </p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: [CollectionDataContract(Name = "<span style="color: #8b0000">SampleItems</span>",Namespace = "<span style="color: #8b0000"></span>")] </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> SampleItems : List&lt;SampleItem&gt; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: { </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: }</pre></pre> <p> </p> <p>Further, if we override the Namespace by setting the Namespace parameter of the attribute and setting it to an empty string, we get a much nice, cleaner result:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_24.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_11.png" width="640" height="427" /></a></p> <p align="center"><font size="1">Note: I have to credit this technique to <a href="http://twitter.com/#!/jonflanders" target="_blank">Jon Flanders</a>, who’s excellent book </font><a href="http://www.amazon.com/RESTful-NET-Build-Consume-Services/dp/0596519206" target="_blank"><font size="1">“Restful .NET”</font></a><font size="1">  is where I first learned this technique a couple of years ago. </font></p> <p>Some developers and administrators may be concerned about the potential performance implications that enabling the runAllManagedModulesForAllRequests attribute introduces for static requests such as HTML pages, image files, etc. since each of these requests must run through all of the configured modules unnecessarily. Fortunately, Microsoft introduced an alternative to this approach in a QFE Hotfix which enables dynamic routing without impacting static requests. You can download and install the Hotfix from here: http://support.microsoft.com/kb/980368. After installing the hotfix, three new handlers with a name prefix of ExtnesionlessUrlHandler are installed in IIS which correspond to 32, 64 bit and integrated modes and applied to all applications. With these handlers installed, you can remove or disable the runAllManagedModulesForAllRequests attribute and all routing will continue to function as expected provided the handlers remain registered as shown below.</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/4187_04_31_2.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="4187_04_31" border="0" alt="4187_04_31" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/4187_04_31_thumb.png" width="640" height="357" /></a></p> <p>As I was walking through the standard endpoint configuration, you may have noticed an attribute on the standard endpoint element called automaticFormattingEnabled. When set to true, this allows you to manipulate whether the service should return XML or JSON. According to MSDN, the determination is based on the following in order:</p> <ol> <li>The media types in the request message’s Accept header. </li> <li>The content-type of the request message. </li> <li>The default format setting in the operation. </li> <li>The default format setting in the WebHttpBehavior. <br /></li> </ol> <p>Using Fiddler, I’ve set the Accept header to application/json which has the result of returning JSON without me having to do anything to the service itself:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_28.png"><img style="background-image: none; border-right-width: 0px; margin: 2px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/41cd8fc99175_1348A/image_thumb_13.png" width="640" height="367" /></a></p> <p>Of course, you can have the service return plain text or a stream, but to do so today, you need to implement a custom mechanism for passing the format you need such as a querystring  and then writing some code to read it and return the appropriate expected format.</p> <p>Finally, one of the biggest benefits of designing REST services, or services that leverage the HTTP protocol exclusively, is that you get all of the features inherent to the HTTP protocol including support for caching requests, or GET requests. By adding an attribute called AspNetCacheProfile to the GetCollection method and mapping the profile name in the web.config, I can leverage the caching capabilities in ASP.NET to cache GET requests:</p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 650px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: [WebGet(UriTemplate = "<span style="color: #8b0000"></span>")] </pre><pre style="background-color: #ffff00; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: [AspNetCacheProfile("<span style="color: #8b0000">MyCacheProfile</span>")] </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: <span style="color: #0000ff">public</span> SingleTracks GetCollection() </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: <span style="color: #0000ff">return</span> GetSingleTracks(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: } </pre></pre> <p> </p> <p>As I hope I’ve shown, there is pretty strong support for REST in WCF 4, both in the box and as provided by the WCF REST specific templates which allows you to easily host your WCF REST services on any host, including Windows Server AppFabric which allows you to take advantage of all of the great management and monitoring capabilities it provides. New features in the WCF Web API will make it even easier to host HTTP/REST services with WCF, so watch this space for some upcoming posts and be sure to keep up with the latest developments on the WCF Community Site at <a title="http://wcf.codeplex.com/" href="http://wcf.codeplex.com/">http://wcf.codeplex.com/</a>.</p><img src="http://rickgaribay.net/aggbug/319.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/10/20/getting-the-most-out-of-wcf-4.0-rest-today-again.aspx Fri, 21 Oct 2011 06:09:10 GMT http://rickgaribay.net/archive/2011/10/20/getting-the-most-out-of-wcf-4.0-rest-today-again.aspx#feedback http://rickgaribay.net/comments/commentRss/319.aspx http://rickgaribay.net/services/trackbacks/319.aspx 5 Years as a Connected Systems Developer MVP http://rickgaribay.net/archive/2011/10/01/5-years-as-a-connected-systems-developer-mvp.aspx <p><a href="https://mvp.support.microsoft.com/" target="_blank"><img style="display: inline; float: right" hspace="0" alt="" align="right" src="http://rickgaribay.net/images/mvp.png" /></a>This morning I <a href="http://twitter.com/#!/rickggaribay/status/120148473520717826" target="_blank">shared</a> the fact that I received a pleasant email early this morning indicating that I have been awarded the <a href="https://mvp.support.microsoft.com/" target="_blank">MVP Award</a> for Connected Systems Developer for my contributions throughout the 2011 award year. </p> <p>It is hard to believe that this is my 5th consecutive award. The last 5 years have been filled with new challenges, roles and lots of excitement. </p> <p>Five years is a significant timeframe in IT because historically, technology shifts pretty dramatically about every 5 years. I <a href="http://rickgaribay.net/archive/2011/08/22/a-middle-tier-guyrsquos-take-on-html-5.aspx" target="_blank">mused about the impact of HTML5 in my recent post</a>, and how just 5 years ago WCF, WPF and Silverlight were brand new, bleeding edge technologies which were Microsoft’s response to a pivotal shift that was taking place in UX, design technology and service composition. Together, each of these technologies and other disruptions have served as a perfect storm for spawning the next major shift in technology: HTML5 and Cloud Computing. The interesting thing is just like 5 years ago, these technologies are still in their infancy. As I shared <a href="http://rickgaribay.net/archive/2011/09/30/hmtl5-web-camp-phoenixndashthe-goods.aspx" target="_blank">yesterday at HTML5 Web Camp</a>, we are all getting in at the ground floor, and just as nothing remains constant but change itself, in another 5 years the technology landscape will look quite different than it does today. …And, just like the last 5 years, it will all happen in the blink of an eye.</p> <p>There was a <a href="http://www.haveyougotwoods.ca/2011/02/02/dropping-my-mvp" target="_blank">blog post</a> earlier this year by a Security MVP who had renounced his award shortly after receiving it because he didn’t see the value in the award and thought that the program was asking too much. Surely, he had done all of the right things to get <a href="https://mvp.support.microsoft.com/gp/mvpbecoming" target="_blank">nominated</a> and was even accepted, but yet (as the comments/feedback from other MVPs confirm) he completely missed the most valuable thing about the program: relationships. Over the last 5 years, I have made some great friends both in the community and the industry as a whole including Microsoft product, business and field groups, and content publishers like Microsoft, EPS/CODE Magazine, Pluralsight and SSWUG which have enriched my career and provided me with new and exciting challenges and opportunities. Most of all, over the last 5 years, these relationships have resulted in new, long-lasting friendships (you know who you are <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/5-Years-as-a-Connected-Systems-Developer_BEF5/wlEmoticon-winkingsmile_2.png" />) and this is truly the <em>reward</em> that transcends the <em>award</em> because it keeps on giving long after the champagne for a new award or re-award has been uncorked. </p> <p>I have always felt that sharing and teaching is a privilege that comes with great responsibility and this another things that makes the MVP Award so rewarding. There is no question that I would have an impact in the community if I wasn’t an MVP, but equally, there is no question that the program has served to amplify my reach beyond what I could accomplish individually, and it continues to do so. The reality is that being an MVP in and of itself really means nothing. It’s what you do with it that counts. </p> <p>So, I think it is fitting to take this opportunity to announce that I have just signed a book deal with <a href="http://www.packtpub.com/" target="_blank">Packt Publishing</a>. I am honored to share this title with <a href="http://twitter.com/#!/@HammadRajjoub" target="_blank">Hammad Rajjoub</a>, fellow CSD MVP and now Architect Evangelist for Microsoft Singapore who really did all of the heavy lifting and was kind enough to present the opportunity to me. Hammad and I both share a passion for Connected Systems and community, and this is a great opportunity for us to share our experience, thoughts and learnings for how the capabilities provided by Windows Server AppFabric can benefit architects and developers building distributed systems today using WCF and WF on the Microsoft platform with an eye towards Hybrid architectures. We will be sharing more details as the shape of the book starts to take form, and if you would be interested in being a technical reviewer, we would be very grateful.</p> <p>Needless to say, it’s going to be a very busy fall/winter, but I wouldn’t have it any other way!</p><img src="http://rickgaribay.net/aggbug/317.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/10/01/5-years-as-a-connected-systems-developer-mvp.aspx Sat, 01 Oct 2011 21:50:44 GMT http://rickgaribay.net/archive/2011/10/01/5-years-as-a-connected-systems-developer-mvp.aspx#feedback 4 http://rickgaribay.net/comments/commentRss/317.aspx http://rickgaribay.net/services/trackbacks/317.aspx Azure AppFabric Service Bus Brokered Messaging GA &amp; Rude CTP Diffs http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx <p>Today at the Build conference in Anaheim California, Satya Nadella, President Server and Tools business announced general availability of the production release of AppFabric Queues and Topics, otherwise known as Brokered Messaging.</p> <p>Brokered Messaging introduces durable queue capabilities and rich, durable pub-sub with topics and subscriptions that compliment the existing Relayed Messaging capabilities.  </p> <p>I covered Brokered Messaging following the <a href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" target="_blank">May CTP release</a> of <a href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" target="_blank">Queues</a> and followed up shortly with an overview and exploration of <a href="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx" target="_blank">Topics</a> (please see some other great resources at the end of this post).</p> <p>Since then, there was a June CTP release which included the new AppFabric Application and no visible changes to Brokered Messaging, however since its release, the AppFabric Messaging team has been hard at work refining the API and behaviors based on feedback from Advisors, MVPs and the community at large. </p> <p>Since I’ve already covered Queues and Topics in the aforementioned posts, I’ll dive right in to some terse examples which demonstrate the API changes. Though not an exhaustive review of all of the changes, I’ve covered the types that your most likely to come across and will cover Queues, Topics and Subscriptions extensively in my upcoming article in <a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank">CODE Magazine</a> which will also include more in-depth walk-throughs of the .NET Client API, REST API and WCF scenarios.</p> <p>Those of you who have worked with the CTPs will find some subtle and not so subtle changes, but all in all I think all of the refinements are for the best and I think you’ll appreciate them as I have. For those new to Azure AppFabric Service Bus Brokered Messaging, you’ll benefit most from reading my first two posts based on the May CTP (or any of the resources at the end of this post) to get an idea of the why behind queues and topics and then come back here to explore the what and how.</p> <p><strong><font size="3">A Quick Note on Versioning</font></strong></p> <p>In the CTPs that preceded the release of the new Azure AppFabric Service Bus features, a temporary assembly called “Microsoft.ServiceBus.Messaging.dll” was added to serve a container for new features and deltas that were introduced during the development cycle. The final release includes a single assembly called “Microsoft.ServiceBus.dll” which contains all of the existing relay capabilities that you’re already familiar with as well as the addition of support for queues and topics. If you are upgrading from the CTPs, you’ll want to get ahold of the new Microsoft.ServiceBus.dll version 1.5 which includes everything plus the new queue and topic features.</p> <p>The new 1.5 version of the Microsoft.ServiceBus.dll assembly targets the .NET 4.0 framework. Customers using .NET 3.5 can continue using the existing Microsoft.ServiceBus.dll  assembly (version 1.0.1123.2) for leveraging the relay capabilities, but must upgrade to .NET 4.0 to take advantage of the latest features presented here.</p> <p><strong><font size="4">.NET Client API</font></strong></p> <p><strong><font size="3">Queues</font></strong></p> <table border="1" cellspacing="0" cellpadding="2" width="1072"><tbody> <tr> <td valign="top" width="251"><strong>May/June CTP</strong></td> <td valign="top" width="251"><strong>General Availability</strong></td> <td valign="top" width="568"><strong>Comments</strong></td> </tr> <tr> <td valign="top" width="251">ServiceBusNamespaceClientSettings</td> <td valign="top" width="251">NamespaceManagerSettings</td> <td valign="top" width="568">New class for encapsulating endpoint and security settings.</td> </tr> <tr> <td valign="top" width="251">N/A</td> <td valign="top" width="251">TokenProvider</td> <td valign="top" width="568">New class for acquiring a WRAP token from ACS.</td> </tr> <tr> <td valign="top" width="251">ServiceBusNamespaceClient</td> <td valign="top" width="251">NamespaceManager</td> <td valign="top" width="568">Root management object for creating Queues, Topics, Subscriptions.</td> </tr> <tr> <td valign="top" width="251">Queue</td> <td valign="top" width="251">QueueDescription</td> <td valign="top" width="568">In May/June CTP, Topic / Queue / Subscription were management objects. All create/delete operations were moved to NamespaceManager and the state operations are now on TopicDescription/QueueDescription etc.</td> </tr> <tr> <td valign="top" width="251">MessagingFactorySettings</td> <td valign="top" width="251">MessagingFactorySettings</td> <td valign="top" width="568">New class for encapsulating security settings.</td> </tr> <tr> <td valign="top" width="251">MessagingFactory</td> <td valign="top" width="251">MessagingFactory</td> <td valign="top" width="568"> </td> </tr> <tr> <td valign="top" width="251">BrokeredMessage</td> <td valign="top" width="251">BrokeredMessage</td> <td valign="top" width="568">No longer a factory. Simply instantiate a BrokeredMessage.</td> </tr> <tr> <td valign="top" width="251">MessageSender</td> <td valign="top" width="251">MessageSender</td> <td valign="top" width="568">Optional, for use when you want to abstract away queue or topic.</td> </tr> <tr> <td valign="top" width="251">MessageReceiver</td> <td valign="top" width="251">MessageReceiver</td> <td valign="top" width="568">Optional, for use when you want to abstract away queue or topic.</td> </tr> </tbody></table> <p><strong></strong></p> <p>Below is a representative sample for creating, configuring, sending and receiving a message on a queue:</p> <p><strong>Administrative Operations</strong></p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 817px; padding-right: 5px; height: 397px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #008000">// Configure and create NamespaceManager for performing administrative operations</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: NamespaceManagerSettings settings = <span style="color: #0000ff">new</span> NamespaceManagerSettings(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: TokenProvider tokenProvider = settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer,key); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: NamespaceManager manager = <span style="color: #0000ff">new</span> NamespaceManager(ServiceBusEnvironment.CreateServiceUri("<span style="color: #8b0000">sb</span>", serviceNamespace, <span style="color: #0000ff">string</span>.Empty), settings); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: <span style="color: #008000">// Check for existence of queues on the fabric</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: var qs = manager.GetQueues(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: var result = from q <span style="color: #0000ff">in</span> qs </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: where q.Path.Equals(queueName, StringComparison.OrdinalIgnoreCase) </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: select q; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: <span style="color: #0000ff">if</span> (result.Count() == 0) </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: Console.WriteLine("<span style="color: #8b0000">Queue does not exist</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: <span style="color: #008000">// Create Queue</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: Console.WriteLine("<span style="color: #8b0000">Creating Queue...</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: manager.CreateQueue(<span style="color: #0000ff">new</span> QueueDescription(queueName) { LockDuration = TimeSpan.FromSeconds(5.0d) }); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: }</pre></pre> <p><strong>Runtime Operations</strong></p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 815px; padding-right: 5px; height: 716px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #008000">// Create and Configure Messaging Factory to provision QueueClient</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: MessagingFactorySettings messagingFactorySettings = <span style="color: #0000ff">new</span> MessagingFactorySettings(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: messagingFactorySettings.TokenProvider = settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: MessagingFactory messagingFactory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri("<span style="color: #8b0000">sb</span>", serviceNamespace, <span style="color: #0000ff">string</span>.Empty), messagingFactorySettings); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: QueueClient queueClient = messagingFactory.CreateQueueClient(queueName, ReceiveMode.PeekLock); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: Order order = <span style="color: #0000ff">new</span> Order(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: order.OrderId = 42; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: order.Products.Add("<span style="color: #8b0000">Kinect</span>", 70.50M); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: order.Products.Add("<span style="color: #8b0000">XBOX 360</span>", 199.99M); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: order.Total = order.Products["<span style="color: #8b0000">Kinect</span>"] + order.Products["<span style="color: #8b0000">XBOX 360</span>"]; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: <span style="color: #008000">// Create a Brokered Message from the Order object</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: BrokeredMessage msg = <span style="color: #0000ff">new</span> BrokeredMessage(order); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: <span style="color: #008000">/*********************** </span></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: *** Send Operations *** </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: ************************/ </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: queueClient.Send(msg); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: <span style="color: #008000">/************************** </span></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: *** Receive Operations *** </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: ***************************/ </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: BrokeredMessage recdMsg; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: Order recdOrder; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: <span style="color: #008000">// Receive and lock message</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: recdMsg = queueClient.Receive(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 32: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 33: <span style="color: #0000ff">if</span>(recdMsg != <span style="color: #0000ff">null</span>) </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 34: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 35: <span style="color: #008000">// Convert from BrokeredMessage to native Order</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 36: recdOrder = recdMsg.GetBody&lt;Order&gt;(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 37: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 38: Console.ForegroundColor = ConsoleColor.Green; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 39: Console.WriteLine("<span style="color: #8b0000">Received Order {0} \n\t with Message Id {1} \n\t and Lock Token:{2} \n\t from {3} \n\t with total of ${4}</span>", recdOrder.OrderId, recdMsg.MessageId, recdMsg.LockToken, "<span style="color: #8b0000">Receiver 1</span>", recdOrder.Total); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 40: recdMsg.Complete(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 41: } </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 42: queueClient.Close();</pre></pre> <p> </p> <p>Note that MessageSender and MessageReceiver are now optional. Here’s an example that shows PeekLocking a message, simulating an exception and trying again:</p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 828px; padding-right: 5px; height: 533px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: <span style="color: #008000">// Alternate receive approach using agnostic MessageReceiver</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: MessageReceiver receiver = messagingFactory.CreateMessageReceiver(queueName); <span style="color: #008000">// Recieve, complete, and delete message from the fabric</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: <span style="color: #0000ff">try</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: <span style="color: #008000">// Receive and lock message</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: recdMsg = receiver.Receive(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: <span style="color: #008000">// Convert from BrokeredMessage to native Order</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: recdOrder = recdMsg.GetBody&lt;Order&gt;(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: <span style="color: #008000">// Complete read, release and delete message from the fabric</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: receiver.Complete(recdMsg.LockToken); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: Console.ForegroundColor = ConsoleColor.Green; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: Console.WriteLine("<span style="color: #8b0000">Received Order {0} \n\t with Message Id {1} \n\t and Lock Token:{2} \n\t from {3} \n\t with total of ${4} \n\t at {5}</span>", recdOrder.OrderId, recdMsg.MessageId, recdMsg.LockToken, "<span style="color: #8b0000">Receiver 2</span>", recdOrder.Total, DateTime.Now.Hour + "<span style="color: #8b0000">:</span>" + DateTime.Now.Minute + "<span style="color: #8b0000">:</span>" + DateTime.Now.Second); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: } </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: <span style="color: #0000ff">catch</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: <span style="color: #008000">// Should processing fail, release the lock from the fabric and make message available for later processing.</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: <span style="color: #0000ff">if</span> (recdMsg != <span style="color: #0000ff">null</span>) </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: { </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: receiver.Abandon(recdMsg.LockToken); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: Console.ForegroundColor = ConsoleColor.Red; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: Console.WriteLine("<span style="color: #8b0000">Message could not be processed.</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: } </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: } </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: <span style="color: #0000ff">finally</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 32: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 33: receiver.Close(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 34: }</pre></pre> <p><strong></strong></p> <p>As shown below, this sample results in order 42 being received by the QueueClient:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_2.png"><img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_thumb.png" width="807" height="127" /></a></p> <br /> <p><strong><font size="3">Topics</font></strong></p> <table border="1" cellspacing="0" cellpadding="0"><tbody> <tr> <td valign="top" width="268"> <p><b>May/June CTP</b></p> </td> <td valign="top" width="239"> <p><b>General Availability</b></p> </td> <td valign="top" width="566"> <p><b>Comments</b></p> </td> </tr> <tr> <td valign="top" width="268"> <p>Topic</p> </td> <td valign="top" width="239"> <p>TopicDescription</p> </td> <td valign="top" width="566"> <p>In May/June CTP, Topic / Queue / Subscription were management objects. All create/delete operations were moved to NamespaceManager and the state operations are now on TopicDescription/QueueDescription etc.</p> </td> </tr> <tr> <td valign="top" width="268"> <p>TopicClient</p> </td> <td valign="top" width="239"> <p>TopicClient</p> </td> <td valign="top" width="566"> <p>As noted in the Queues section, you can use TopicClient or MessageSender in the event you want to abstract details of using Topics.</p> </td> </tr> <tr> <td valign="top" width="268"> <p>SubscriptionClient</p> </td> <td valign="top" width="239"> <p>SubscriptionClient</p> </td> <td valign="top" width="566"> <p>As noted in the Queues section, you can use SubscriptionClient or MessageReceiver in the event you want to abstract details of using a Topic/Subscription.</p> </td> </tr> <tr> <td valign="top" width="268"> <p>Subscription</p> </td> <td valign="top" width="239"> <p>SubscriptionDescription</p> </td> <td valign="top" width="566">Changes to constructors and use of properties (see code samples below), but intent is the same.</td> </tr> <tr> <td valign="top" width="268"> <p>RuleDescription</p> </td> <td valign="top" width="239"> <p>RuleDescription</p> </td> <td valign="top" width="566">Changes to constructors and use of properties (see code samples below), but intent is the same.</td> </tr> <tr> <td valign="top" width="268"> <p>FilterExpression</p> </td> <td valign="top" width="239"> <p>Filter</p> </td> <td valign="top" width="566"> <p>Base for Filter types such as SqlFilter</p> </td> </tr> <tr> <td valign="top" width="268"> <p>SqlFilterExpression</p> </td> <td valign="top" width="239"> <p>SqlFilter</p> </td> <td valign="top" width="566"> </td> </tr> <tr> <td valign="top" width="268"> <p>FilterAction</p> </td> <td valign="top" width="239"> <p>RuleAction</p> </td> <td valign="top" width="566"> </td> </tr> </tbody></table> <p> </p> <p>Below is a representative sample for creating, configuring, sending and receiving a message on a topic:</p> <p><strong>Administrative Operations</strong></p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 836px; padding-right: 5px; height: 632px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #008000">// Configure and create NamespaceManager for performing administrative operations</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: NamespaceManagerSettings settings = <span style="color: #0000ff">new</span> NamespaceManagerSettings(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: settings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: NamespaceManager manager = <span style="color: #0000ff">new</span> NamespaceManager(ServiceBusEnvironment.CreateServiceUri("<span style="color: #8b0000">sb</span>", serviceNamespace, <span style="color: #0000ff">string</span>.Empty), settings); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: <span style="color: #008000">// Check for existence of topics on the fabric</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: var topics = manager.GetTopics(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: var result = from t <span style="color: #0000ff">in</span> topics </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: where t.Path.Equals(topicName, StringComparison.OrdinalIgnoreCase) </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: select t; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: <span style="color: #0000ff">if</span> (result.Count() == 0) </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: Console.WriteLine("<span style="color: #8b0000">Topic does not exist</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: <span style="color: #008000">// Create Queue</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: Console.WriteLine("<span style="color: #8b0000">Creating Topic...</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: TopicDescription topic = manager.CreateTopic(topicName); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: } </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: <span style="color: #008000">// Create Subscriptions for InventoryServiceSubscription and CreditServiceSubscription and associate to OrdersTopic:</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: SubscriptionDescription inventoryServiceSubscription = <span style="color: #0000ff">new</span> SubscriptionDescription(topicName, "<span style="color: #8b0000">InventoryServiceSubscription</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: SubscriptionDescription creditServiceSubscription = <span style="color: #0000ff">new</span> SubscriptionDescription(topicName, "<span style="color: #8b0000">CreditServiceSubscription</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: <span style="color: #008000">// Set up Filters for NorthAmericaFulfillmentServiceSubscription</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: RuleDescription northAmericafulfillmentRuleDescription = <span style="color: #0000ff">new</span> RuleDescription(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: northAmericafulfillmentRuleDescription.Filter = <span style="color: #0000ff">new</span> SqlFilter("<span style="color: #8b0000">CountryOfOrigin = 'USA' OR CountryOfOrigin ='Canada' OR CountryOfOrgin ='Mexico'</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: northAmericafulfillmentRuleDescription.Action = <span style="color: #0000ff">new</span> SqlRuleAction("<span style="color: #8b0000">set FulfillmentRegion='North America'</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 32: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 33: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 34: <span style="color: #008000">// Create Subscriptions</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 35: SubscriptionDescription northAmericaFulfillmentServiceSubscription = <span style="color: #0000ff">new</span> SubscriptionDescription(topicName, "<span style="color: #8b0000">NorthAmericaFulfillmentServiceSubscription</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 36: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 37: <span style="color: #008000">// Delete existing subscriptions</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 38: <span style="color: #0000ff">try</span> { manager.DeleteSubscription(topicName, inventoryServiceSubscription.Name); } <span style="color: #0000ff">catch</span> { }; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 39: <span style="color: #0000ff">try</span> { manager.DeleteSubscription(topicName, creditServiceSubscription.Name); } <span style="color: #0000ff">catch</span> { }; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 40: <span style="color: #0000ff">try</span> { manager.DeleteSubscription(topicName, northAmericaFulfillmentServiceSubscription.Name); } <span style="color: #0000ff">catch</span> { }; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 41: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 42: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 43: <span style="color: #008000">// Add Subscriptions and Rules to Topic</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 44: manager.CreateSubscription(inventoryServiceSubscription); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 45: manager.CreateSubscription(creditServiceSubscription); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 46: manager.CreateSubscription(northAmericaFulfillmentServiceSubscription, northAmericafulfillmentRuleDescription); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 47: </pre></pre> <p><strong></strong></p> <p><strong>Runtime Operations</strong></p> <p><strong></strong></p> <pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 842px; padding-right: 5px; height: 631px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 1: <span style="color: #008000">// Create and Configure Messaging Factory to provision TopicClient</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 2: MessagingFactorySettings runtimeSettings = <span style="color: #0000ff">new</span> MessagingFactorySettings(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 3: runtimeSettings.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuer, key); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 4: MessagingFactory messagingFactory = MessagingFactory.Create(ServiceBusEnvironment.CreateServiceUri("<span style="color: #8b0000">sb</span>",serviceNamespace,String.Empty),runtimeSettings); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 5: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 6: <span style="color: #008000">// Create Topic Client for sending messages to the Topic:</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 7: TopicClient client = messagingFactory.CreateTopicClient(topicName); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 8: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 9: <span style="color: #008000">/*********************** </span></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 10: *** Send Operations *** </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 11: ***********************/ </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 12: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 13: <span style="color: #008000">// Prepare BrokeredMessage and corresponding properties</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 14: Order order = <span style="color: #0000ff">new</span> Order(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 15: order.OrderId = 42; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 16: order.Products.Add("<span style="color: #8b0000">Kinect</span>", 70.50M); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 17: order.Products.Add("<span style="color: #8b0000">XBOX 360</span>", 199.99M); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 18: order.Total = order.Products["<span style="color: #8b0000">Kinect</span>"] + order.Products["<span style="color: #8b0000">XBOX 360</span>"]; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 19: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 20: <span style="color: #008000">// Set the body to the Order data contract</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 21: BrokeredMessage msg = <span style="color: #0000ff">new</span> BrokeredMessage(order); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 22: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 23: <span style="color: #008000">// Set properties for use in RuleDescription</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 24: msg.Properties.Add("<span style="color: #8b0000">CountryOfOrigin</span>", "<span style="color: #8b0000">USA</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 25: msg.Properties.Add("<span style="color: #8b0000">FulfillmentRegion</span>", "<span style="color: #8b0000"></span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 26: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 27: <span style="color: #008000">// Send the message to the OrdersTopic</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 28: client.Send(msg); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 29: client.Close(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 30: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 31: <span style="color: #008000">/************************** </span></pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 32: *** Receive Operations *** </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 33: ****************************/ </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 34: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 35: BrokeredMessage recdMsg; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 36: Order recdOrder; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 37: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 38: <span style="color: #008000">// Inventory Service Subscriber</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 39: SubscriptionClient inventoryServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "<span style="color: #8b0000">InventoryServiceSubscription</span>",ReceiveMode.PeekLock); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 40: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 41: <span style="color: #008000">// Read the message from the OrdersTopic</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 42: <span style="color: #0000ff">while</span> ((recdMsg = inventoryServiceSubscriber.Receive(TimeSpan.FromSeconds(5))) != <span style="color: #0000ff">null</span>) </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 43: { </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 44: <span style="color: #008000">// Convert from BrokeredMessage to native Order</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 45: recdOrder = recdMsg.GetBody&lt;Order&gt;(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 46: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 47: <span style="color: #008000">// Complete read, release and delete message from the fabric</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 48: inventoryServiceSubscriber.Complete(recdMsg.LockToken); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 49: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 50: Console.ForegroundColor = ConsoleColor.Green; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 51: Console.WriteLine("<span style="color: #8b0000">Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.</span>", recdOrder.OrderId, "<span style="color: #8b0000">Inventory Service Subscriber</span>", recdMsg.MessageId, recdMsg.LockToken); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 52: } </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 53: inventoryServiceSubscriber.Close(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 54: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 55: <span style="color: #008000">// Credit Service Subscriber</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 56: SubscriptionClient creditServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "<span style="color: #8b0000">CreditServiceSubscription</span>"); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 57: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 58: <span style="color: #008000">// Read the message from the OrdersTopic</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 59: recdMsg = creditServiceSubscriber.Receive(); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 60: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 61: <span style="color: #008000">// Convert from BrokeredMessage to native Order</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 62: recdOrder = recdMsg.GetBody&lt;Order&gt;(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 63: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 64: <span style="color: #008000">// Complete read, release and delete message from the fabric</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 65: creditServiceSubscriber.Complete(recdMsg.LockToken); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 66: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 67: Console.ForegroundColor = ConsoleColor.Green; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 68: Console.WriteLine("<span style="color: #8b0000">Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.</span>", recdOrder.OrderId, "<span style="color: #8b0000">Credit Service Subscriber</span>", recdMsg.MessageId, recdMsg.LockToken); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 69: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 70: creditServiceSubscriber.Close(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 71: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 72: <span style="color: #008000">// Fulfillment Service Subscriber for the North America Fulfillment Service Subscription</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 73: SubscriptionClient northAmericaFulfillmentServiceSubscriber = messagingFactory.CreateSubscriptionClient(topicName, "<span style="color: #8b0000">northAmericaFulfillmentServiceSubscription</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 74: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 75: <span style="color: #008000">// Read the message from the OrdersTopic for the North America Fulfillment Service Subscription</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 76: recdMsg = northAmericaFulfillmentServiceSubscriber.Receive(TimeSpan.FromSeconds(5)); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 77: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 78: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 79: <span style="color: #0000ff">if</span>(recdMsg != <span style="color: #0000ff">null</span>) </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 80: { </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 81: <span style="color: #008000">// Convert from BrokeredMessage to native Order</span> </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 82: recdOrder = recdMsg.GetBody&lt;Order&gt;(); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 83: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 84: <span style="color: #008000">// Complete read, release and delete message from the fabric</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 85: northAmericaFulfillmentServiceSubscriber.Complete(recdMsg.LockToken); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 86: </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 87: Console.ForegroundColor = ConsoleColor.Green; </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 88: Console.WriteLine("<span style="color: #8b0000">Received Order {0} \n\t on {1} \n\t with Message Id {2} \n\t and Lock Token {3}.</span>", recdOrder.OrderId, "<span style="color: #8b0000">North America Fulfillment Service Subscriber</span>", recdMsg.MessageId, recdMsg.LockToken); </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 89: } </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 90: <span style="color: #0000ff">else</span> </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 91: { </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 92: Console.ForegroundColor = ConsoleColor.Yellow; </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 93: Console.WriteLine("<span style="color: #8b0000">No messages for North America found.</span>"); </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 94: } </pre><pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 95: </pre><pre style="background-color: #ffffff; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px"> 96: northAmericaFulfillmentServiceSubscriber.Close();</pre></pre> <p><strong><font size="3"></font></strong></p> <p>When running this sample, you’ll see that I have received Order 42 on my Inventory, Credit and North America Fulfillment Service subscriptions:</p> <p><a href="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_6.png"><img style="background-image: none; border-right-width: 0px; margin: 2px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/AppFabric-Service-Bus-Queues--Topics-Rel_D1C0/image_thumb_2.png" width="802" height="244" /></a></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="3"></font></strong></p> <p><strong><font size="4">WCF</font></strong></p> <p>One of the great things about the WCF programming model is that it abstracts much of the underlying communication details and as such, other than dropping in a new assembly and and refactoring the binding and configuration, it is not greatly affected by the API changes from the May/June CTP to GA.</p> <p>As I mentioned, one thing that has changed is that the ServiceBusMessagingBinding has been renamed to NetMessagingBinding. I’ll be covering and end to end example of using the NetMessagingBinding in my upcoming article in <a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank">CODE Magazine</a>.</p> <p><strong><font size="4">REST API</font></strong></p> <p>The REST API is key to delivering these new capabilities across a variety of client platforms and remains largely unchanged, however one key change is how message properties are handled. Instead of individual headers for each, there is now one header with  all the properties JSON encoded. Please refer to the updated REST API Reference doc for details. I’ll also be covering and end-to-end example of using the REST API to write an read to/from a queue in my upcoming article in <a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank">CODE Magazine</a>.</p> <p><strong><font size="4">More Coming Soon</font></strong></p> <p>As I mentioned, in my upcoming article in <a href="http://www.code-magazine.com/SearchResults.aspx?search=garibay" target="_blank">CODE Magazine</a>, I’ll cover the Why, What, and How behind Azure AppFabric Service Bus Brokered Messaging including end to end walkthroughs with the .NET Client API, REST API and WCF Binding. The November/December issue should be on newsstands (including Barnes and Noble) or your mailbox towards the end of October. You can also find the article online at <a href="http://code-magazine.com">http://code-magazine.com</a></p> <p><strong><font size="4">Resources</font></strong></p> <p>You can learn more about this exciting release as well as download the GA SDK version 1.5 by visiting the following resources:</p> <ul> <li>Azure AppFabric SDK 1.5:<a title="http://www.microsoft.com/download/en/details.aspx?id=27421" href="http://www.microsoft.com/download/en/details.aspx?id=27421">http://www.microsoft.com/download/en/details.aspx?id=27421</a> </li> <li><a href="http://twitter.com/clemensv" target="_blank">Clemens Vasters</a> on the May CTP: <a title="http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx" href="http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx">http://vasters.com/clemensv/2011/05/16/Introducing+The+Windows+Azure+AppFabric+Service+Bus+May+2011+CTP.aspx</a>  </li> <li>Great video by <a href="http://twitter.com/clemensv" target="_blank">Clemens Vasters</a> on Brokered Messaging: <a title="http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx" href="http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx">http://vasters.com/clemensv/2011/06/11/Understanding+Windows+Azure+AppFabric+Queues+And+Topics.aspx</a>  </li> <li><a href="http://twitter.com/#!/dingha" target="_blank">David Ingham</a> on Queues: <a title="http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx" href="http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx">http://blogs.msdn.com//b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx</a> </li> <li><a href="http://twitter.com/#!/dingha" target="_blank">David Ingham</a> on Topics: <a title="http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx" href="http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx">http://blogs.msdn.com//b/appfabric/archive/2011/05/25/an-introduction-to-service-bus-topics.aspx</a>  </li> <li><a href="http://twitter.com/rickggaribay" target="_blank">My</a> Introduction to Queues: <a title="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx" href="http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx">http://rickgaribay.net/archive/2011/05/17/appfabric-service-bus-v2-ctp.aspx</a>  </li> <li><a href="http://twitter.com/rickggaribay" target="_blank">My</a> Introduction to Topics:<a title="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx" href="http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx">http://rickgaribay.net/archive/2011/05/31/exploring-appfabric-service-bus-v2-may-ctp-topics.aspx</a> </li> </ul><img src="http://rickgaribay.net/aggbug/315.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx Wed, 14 Sep 2011 16:46:52 GMT http://rickgaribay.net/archive/2011/09/14/azure-appfabric-service-bus-brokered-messaging-ga-amp-rude-ctp.aspx#feedback 2 http://rickgaribay.net/comments/commentRss/315.aspx http://rickgaribay.net/services/trackbacks/315.aspx DB Tech Con 2011 http://rickgaribay.net/archive/2011/03/18/db-tech-con-2011.aspx <p><a href="https://www.vconferenceonline.com/event/regeventp.aspx?id=169"><img style="display: block; float: none; margin-left: auto; margin-right: auto" title="dbtechconbannerad" alt="dbtechconbannerad" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/5f7265b713fc_CA5A/dbtechconbannerad_3.gif" width="728" height="90" /></a></p> <p>I had the privilege of recording 3 sessions in the SSWUG studio this week for the upcoming DB Tech Con conference on April 20-22. This is the largest online conference in IT the world, with speakers covering topics ranging from .NET, SQL Server and cloud.</p> <p>The focus of my track is all about hybrid solutions in the enterprise and how you can take advantage of AppFabric and BizTalk as a comprehensive platform for building on-premise solutions that take advantage of the cloud in a pragmatic way.</p> <p>You can find the full session schedule by clicking <a href="http://www.vconferenceonline.com/event/sessions.aspx?id=169&amp;offset=7">here</a> and below is an abstract of my sessions that will air starting April 20th: </p> <p><strong>Building Occasionally Connected Hybrid Applications </strong></p> <p>Keeping applications and devices synchronized with a company’s back office is a common challenge. Retail, transportation and oil and gas are just a few industries that rely on the ability of software solution deployed outside of the data center to be respond to external events that may occur virtually anywhere. As organizations move certain assets to the cloud, occasionally connected applications are becoming the norm, creating a new breed of hybrid applications. In this session, learn how to implement a sophisticated pattern for enabling push synchronization across your applications and services using Microsoft Sync Framework, SQL Azure and WCF 4.</p> <p><strong>Building Composite Enterprise Hybrid Services with AppFabric and BizTalk 2010</strong> <a href="https://www.vconferenceonline.com/event/regeventp.aspx?id=169"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="" border="0" alt="" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/5f7265b713fc_CA5A/sswug_button_spring2011_3.png" width="240" height="80" /></a></p> <p>AppFabric and BizTalk 2010 provide a comprehensive middleware platform for developing, deploying, and managing composite enterprise capabilities both on-premise and in the cloud. Come learn how AppFabric and BizTalk Server can benefit your approach to building and supporting application services at enterprise scale while transcending traditional trust boundaries and enabling the hybrid enterprise. </p> <p><strong>Hosting WF Services in Windows Azure, Today &amp; Tomorrow </strong></p> <p>Workflow Services bring many benefits that help you build modern, responsive composite applications. Learn best practice for building and hosting Workflow Services on-premise as well as how you can take advantage of Windows Azure for hosting your workflow services today along with improvements coming to Windows Azure which will make hosting your workflow services in Azure more compelling than ever. </p> <p>The good folks at SSWUG are offering a $30 discount code on registration for anyone who provides a discount code of <strong>SP11DBTechRG </strong>during registration. If you’ve already registered, you can take advantage of this discount by updating your registration and providing the code.</p> <p>If you are planning on attending, drop me a line on <a href="http://twitter.com/rickggaribay" target="_blank">twitter</a> and be sure to say hi in the chat room when my sessions air.</p><img src="http://rickgaribay.net/aggbug/304.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/03/18/db-tech-con-2011.aspx Fri, 18 Mar 2011 21:38:03 GMT http://rickgaribay.net/archive/2011/03/18/db-tech-con-2011.aspx#feedback http://rickgaribay.net/comments/commentRss/304.aspx http://rickgaribay.net/services/trackbacks/304.aspx New Microsoft Whitepaper on Extending WCF Apps for Windows Azure http://rickgaribay.net/archive/2011/03/07/new-microsoft-whitepaper-on-extending-wcf-apps-for-windows-azure.aspx <p><a href="http://www.microsoft.com/en-us/cloud/developer/resource.aspx?resourceId=developing-and-extending-apps" target="_blank"><img style="background-image: none; border-right-width: 0px; margin: 6px 8px 4px 4px; padding-left: 0px; padding-right: 0px; display: inline; float: left; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="left" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/New-Microsoft-Whitepaper-on-Extending-WC_9EBB/image_5.png" width="244" height="228" /></a>I’m pleased to share that Microsoft has just published my whitepaper “<a href="http://www.microsoft.com/en-us/cloud/developer/resource.aspx?resourceId=developing-and-extending-apps" target="_blank">Developing and Extending Apps for Windows Azure with Visual Studio</a>”: <a href="http://www.microsoft.com/en-us/cloud/developer/resource.aspx?resourceId=developing-and-extending-apps" target="_blank">http://www.microsoft.com/en-<a href="http://msdn.microsoft.com/visualstudio" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/New-Microsoft-Whitepaper-on-Extending-WC_9EBB/image_15.png" width="230" height="29" /></a>us/cloud/developer/resource.aspx?resourceId=developing-and-extending-apps</a></p> <p>In this whitepaper, I summarize the significance of cloud computing today and disambiguate the differences between Software as a Service (SaaS), Platform and a Service (PaaS) and Infrastructure as a Service (IaaS) before providing you with an introduction to Windows Azure.<a href="http://msdn.microsoft.com/netframework" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 3px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/New-Microsoft-Whitepaper-on-Extending-WC_9EBB/image_16.png" width="136" height="34" /></a></p> <p>I then show you how to extend an existing WCF 4.0 application service for deployment to Windows Azure with Visual Studio by adding a Windows Azure Project and associating it with a web role. Then I demonstrate how simple Visual Studio 2010 makes testing a cloud application locally before packaging it for deployment to Windows Azure and walk you through the complete Windows Azure Management Portal experience.</p> <p>If you are evaluating Windows Azure, and want to understand what the development<a title="http://www.microsoft.com/en-us/cloud/developer/resource.aspx?resourceId=developing-and-extending-apps" href="http://msdn.microsoft.com/azure" target="_blank"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 3px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://rickgaribay.net/images/rickgaribay_net/Windows-Live-Writer/New-Microsoft-Whitepaper-on-Extending-WC_9EBB/image_726311e7-1e1e-425a-8c69-423ff9906ed6.png" width="218" height="34" /></a>, deployment and management lifecycle looks like with Visual Studio 2010, then this is the whitepaper for you!</p> <p>Special thanks to my editor, Erik Ruthruff at A23 Consulting and the great folks at EPS for your team work and stellar collaboration.</p><img src="http://rickgaribay.net/aggbug/303.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/03/07/new-microsoft-whitepaper-on-extending-wcf-apps-for-windows-azure.aspx Mon, 07 Mar 2011 18:51:38 GMT http://rickgaribay.net/archive/2011/03/07/new-microsoft-whitepaper-on-extending-wcf-apps-for-windows-azure.aspx#feedback http://rickgaribay.net/comments/commentRss/303.aspx http://rickgaribay.net/services/trackbacks/303.aspx Building Composite Hybrid App Services with AppFabric http://rickgaribay.net/archive/2011/02/21/building-composite-app-services-with-appfabric.aspx <table><tbody> <tr> <td><img style="display: block; float: none; margin-left: auto; margin-right: auto" alt="" src="http://image.exct.net/lib/fefe1372756206/m/1/AppFab_01.png" width="692" height="229" /> <br />Here are the links to my most recent talks on AppFabric including Service Bus (1/12) and bringing it all together with Server AppFabric (2/9).  <br /> <br /><a href="http://www.neudesic.com/insight/Presentation/Pages/PW20110209.aspx" target="_blank">Building Composite Hybrid Application Services with AppFabric</a> <br /> <br /><a href="http://www.neudesic.com/insight/Presentation/Pages/PW20110112.aspx" target="_blank">AppFabric Service Bus</a> <br /> <br />In the final webcast in my series on AppFabric, I discuss how Windows Server AppFabric extends the core capabilities of IIS and WAS by providing a streamlined on-premise hosting experience for WCF 4 and WF 4 Workflow Services, including elastic scale via distributed caching as well as how Windows AppFabric can benefit your approach to building and supporting composite application services via enhanced lifetime management, tracking and persistence of long-running work flow services all while providing a simple, IT Pro-friendly user interface. <br /> <br />The webcast includes a number of demos including the management of WF 4 Workflow Services on-prem with Server AppFabric as well as composing calls between a WCF service hosted in an Azure Web Role with an on-premise service via AppFabric Service Bus to deliver hybrid platform as a service capabilities today. <br /></td> </tr> <!-- End Save for Web Slices --></tbody></table><img src="http://rickgaribay.net/aggbug/301.aspx" width="1" height="1" /> Rick G. Garibay http://rickgaribay.net/archive/2011/02/21/building-composite-app-services-with-appfabric.aspx Mon, 21 Feb 2011 20:55:36 GMT http://rickgaribay.net/archive/2011/02/21/building-composite-app-services-with-appfabric.aspx#feedback http://rickgaribay.net/comments/commentRss/301.aspx http://rickgaribay.net/services/trackbacks/301.aspx