<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Will's Blog</title><link>http://blogs.msdn.com/b/willpe/</link><description>Thoughts on AppFabric, Azure and the Cloud</description><dc:language>en-US</dc:language><generator>Telligent Community 5.6.583.14036 (Build: 5.6.583.14036)</generator><item><title>AppFabric Service Bus on NuGet and CodePlex</title><link>http://blogs.msdn.com/b/willpe/archive/2011/05/25/appfabric-service-bus-on-nuget-and-codeplex.aspx</link><pubDate>Wed, 25 May 2011 14:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10167538</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10167538</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10167538</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2011/05/25/appfabric-service-bus-on-nuget-and-codeplex.aspx#comments</comments><description>
&lt;p&gt;Today, the Service Bus team is happy to announce a couple of initiatives to make it even easier to get started learning and using the Service Bus: the &lt;a href="http://nuget.org/List/Packages/WindowsAzure.ServiceBus"&gt;AppFabric Service Bus NuGet Package&lt;/a&gt; and the &lt;a href="http://servicebus.codeplex.com/"&gt;Service Bus Samples CodePlex Site&lt;/a&gt;. Both our Samples and SDK are still available as a &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B"&gt;download from MSDN&lt;/a&gt;, but we're hopeful that these new choices might be simpler and more convenient.&lt;/p&gt;
&lt;h3&gt;Service Bus on NuGet&lt;/h3&gt;
&lt;p&gt;&lt;a href="http://nuget.org/"&gt;NuGet&lt;/a&gt; is an open source package manager for .Net which is integrated into Visual Studio and makes it simple to install and update libraries. While traditionally you would need to download an install an SDK before using it within your projects, NuGet adds a new 'Add Library Package Reference' option to Visual Studio which downloads, configures and updates the references you select automatically. The &lt;a href="http://nuget.org/List/Packages/WindowsAzure.ServiceBus"&gt;Service Bus NuGet Package&lt;/a&gt; contains two DLL files and configuration information needed to use the AppFabric May CTP - you can use this package &lt;b&gt;instead of&lt;/b&gt; needing to download and install the Windows Azure AppFabric SDK v2.0 CTP May 2011 Update. Give it a try and let us know what you think in the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/appfabricctp"&gt;AppFabric CTP Forums&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Service Bus Samples on CodePlex&lt;/h3&gt;
&lt;p&gt;We're also excited today to offer you a new way to find and browse our library of sample code at our new &lt;a href="http://servicebus.codeplex.com"&gt;CodePlex&lt;/a&gt; site. We'll be using the CodePlex site to help get more samples, tools and utilities out into your hands early and often. You can &lt;a href="http://servicebus.codeplex.com/SourceControl/BrowseLatest"&gt;Browse the Source Code&lt;/a&gt; online or Download a copy if you prefer. Our CodePlex site licenses sample code to you under the open &lt;a href="http://www.apache.org/licenses/LICENSE-2.0"&gt;Apache 2.0 License&lt;/a&gt; - we're hopeful that makes it easier to re-use, re-distribute and share our sample code and tools. We'll be adding more code to the site regularly and would love to hear your &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/appfabricctp"&gt;feedback&lt;/a&gt; on the things you'd like to see us share.&lt;/p&gt;
&lt;p&gt;As always, we're constantly hoping to hear from you about how we're doing - are CodePlex and NuGet useful delivery vehicles for you, or do you prefer to download and install the SDK and Samples? Please &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/appfabricctp"&gt;let us know&lt;/a&gt; on the forums!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10167538" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/AppFabric/">AppFabric</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Service+Bus/">Service Bus</category></item><item><title>Using the Service Bus via REST / HTTP</title><link>http://blogs.msdn.com/b/willpe/archive/2011/05/18/using-the-service-bus-via-rest-http.aspx</link><pubDate>Wed, 18 May 2011 12:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10166056</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10166056</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10166056</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2011/05/18/using-the-service-bus-via-rest-http.aspx#comments</comments><description>
&lt;p&gt;The &lt;a href="http://blogs.msdn.com/b/appfabric/archive/2011/05/14/announcing-the-windows-azure-appfabric-ctp-may-and-june-releases.aspx"&gt;new Service Bus Durable Messaging features&lt;/a&gt; introduced with the May 2011 CTP are really cool, and what's even better than a slew of new messaging features added to the AppFabric is the fact that many of them are accessible from clients on any platform using HTTP. In this post, I'm going to introduce you to using the Service Bus REST endpoint for Messaging; some of it might remind you of the &lt;a href="http://blogs.msdn.com/b/willpe/archive/2010/11/01/getting-started-with-service-bus-v2-october-ctp-connection-points.aspx"&gt;October CTP&lt;/a&gt;, we'll be using Queues (so taking a look at &lt;a href="http://blogs.msdn.com/b/appfabric/archive/2011/05/17/an-introduction-to-service-bus-queues.aspx"&gt;David's post&lt;/a&gt; from Tuesday could be a good idea), and getting to grips with &lt;a href="http://blogs.msdn.com/b/willpe/archive/2011/05/12/getting-access-control-service-tokens-via-http.aspx"&gt;How Access Control Tokens work over HTTP&lt;/a&gt; would be a great primer, too.&lt;/p&gt;
&lt;h3&gt;A Preface to the RESTful Service Bus&lt;/h3&gt;
&lt;p&gt;Typically, users of the Service Bus download and install the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D89640FC-C552-446E-AEAD-B1E0D940F31B"&gt;AppFabric SDK&lt;/a&gt;, add a reference to &lt;i&gt;Microsoft.ServiceBus&lt;/i&gt; and/or &lt;i&gt;Microsoft.ServiceBus.Messaging&lt;/i&gt; and use the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.servicebus.servicebusnamespaceclient.aspx"&gt;ServiceBusNamespaceClient&lt;/a&gt; to perform management operations (creating, enumerating and deleting any queues, topics or subscriptions) or the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.messagingfactory.aspx"&gt;MessagingFactory&lt;/a&gt; to Send and Receive messages. Details like addressing and security are taken care of by the SDK: there's no need to get or renew Access Control Service tokens and no need to interact directly with the service - you just use the SDK. With the REST endpoint, you get a little closer to the metal which - in this geek's humble opinion - can be at least a little bit more fun! &lt;/p&gt;
&lt;p&gt;Wherever possible, you'll want to use our SDK. It sheilds you from some of the underlying complexity of the service, may help to protect you as features change in future and - frankly - it's just a lot easier. That said, there are plenty of times when you won't be able to use the SDK, for example: when working on a non desktop .Net Framework version (like Windows Phone 7 or Silverlight); when working on non-microsoft platforms (like iOS, Android, Java, PHP or Ruby); and when working with older versions of the .Net Framework.&lt;/p&gt;
&lt;p&gt;For convenience and consistency, the code samples in this post are shown in C# - that's not because you'd be writing in C# when using the Service Bus from iOS, PHP or Ruby, of course! I want to focus today on showing some of the basics of using our REST API from a language that many of you will be familiar with. That said, you can look forward to future posts in a wider variety of languages showing the awesome things you can do with Service Bus across platforms and devices.&lt;/p&gt;
&lt;p&gt;There are 5 things I'll be covering in this post to get you started - please leave your feedback on areas you'd like have more detail, examples and guidance either in the comments (below) or the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/appfabricctp/"&gt;AppFabric CTP Forums&lt;/a&gt;. &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Get a security token from the Access Control Service &lt;/li&gt;
&lt;li&gt;Create a Queue in your service namespace &lt;/li&gt;
&lt;li&gt;Send a Message to the Queue &lt;/li&gt;
&lt;li&gt;Receive the Message from the Queue &lt;/li&gt;
&lt;li&gt;Delete the Queue &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;We're going to be busy - so make sure you have an account set up at the &lt;a href="https://portal.appfabriclabs.com/"&gt;AppFabric Labs Portal&lt;/a&gt; and Lets Get Started!&lt;/p&gt;
&lt;h3&gt;Getting and Using a Security Token&lt;/h3&gt;
&lt;p&gt;Last Week, I provided some guidance on &lt;a href="http://blogs.msdn.com/b/willpe/archive/2011/05/12/getting-access-control-service-tokens-via-http.aspx"&gt;Getting and Understanding an Access Control Service Token via HTTP&lt;/a&gt;, so I won't provide a huge level of detail today on the topic. Suffice to say, the service bus requires that you present a WRAP access token in the HTTP Authorization Header, like this: &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="keyword"&gt;Authorization&lt;/span&gt;: &lt;span class="string"&gt;WRAP access_token="&lt;i&gt;&amp;lt;Your Token Here&amp;gt;&lt;/i&gt;"&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Firstly, we'll get a token from ACS using the Issuer Name and Key which you can look up in the &lt;a href="https://portal.appfabriclabs.com/"&gt;AppFabric Portal&lt;/a&gt;: &lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="keyword"&gt;string&lt;/span&gt; serviceNamespace = &lt;span class="string"&gt;"contoso"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; issuerName  = &lt;span class="string"&gt;"owner"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; issuerPassword = &lt;span class="string"&gt;"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa="&lt;/span&gt;;

&lt;span class="keyword"&gt;string&lt;/span&gt; acsBaseAddress = &lt;span class="string"&gt;"https://"&lt;/span&gt; + serviceNamespace + &lt;span class="string"&gt;"-sb.accesscontrol.appfabriclabs.com/"&lt;/span&gt;;

&lt;span class="comment"&gt;// Note that the scheme is Http&lt;/span&gt;
&lt;span class="keyword"&gt;string&lt;/span&gt; relyingPartyAddress = &lt;span class="string"&gt;"http://"&lt;/span&gt; + serviceNamespace + &lt;span class="string"&gt;".servicebus.appfabriclabs.com/"&lt;/span&gt;;

&lt;span class="comment"&gt;// Create the body of the Post Request, formatted as a HTTP Form&lt;/span&gt;
&lt;span class="keyword"&gt;string&lt;/span&gt; postData = &lt;span class="string"&gt;"wrap_scope="&lt;/span&gt; + &lt;span class="user-type"&gt;Uri&lt;/span&gt;.EscapeDataString(relyingPartyAddress) +
                  &lt;span class="string"&gt;"&amp;amp;wrap_name="&lt;/span&gt; + &lt;span class="user-type"&gt;Uri&lt;/span&gt;.EscapeDataString(issuerName) +
                  &lt;span class="string"&gt;"&amp;amp;wrap_password="&lt;/span&gt; + &lt;span class="user-type"&gt;Uri&lt;/span&gt;.EscapeDataString(issuerPassword);

&lt;span class="keyword"&gt;string&lt;/span&gt; authorizationToken;
&lt;span class="keyword"&gt;using&lt;/span&gt; (&lt;span class="user-type"&gt;WebClient&lt;/span&gt; acsWebClient = new&lt;span&gt;&lt;/span&gt; &lt;span class="user-type"&gt;WebClient&lt;/span&gt;())
{
    &lt;span class="comment"&gt;// The response contains the access token and its expiry time formatted as an HTTP 
    // Form like: wrap_access_token=&amp;lt;token&amp;gt;&amp;amp;wrap_expiry_time=2000&lt;/span&gt;
    &lt;span class="keyword"&gt;string&lt;/span&gt; response = acsWebClient.UploadString(acsAddress, &lt;span class="string"&gt;"POST"&lt;/span&gt;, postData);

    &lt;span class="keyword"&gt;string&lt;/span&gt;[] tokenVariables = response.Split(&lt;span class="string"&gt;'&amp;amp;'&lt;/span&gt;);
    &lt;span class="keyword"&gt;string&lt;/span&gt;[] tokenVariable = tokenVariables[0].Split(&lt;span class="string"&gt;'='&lt;/span&gt;);
    authorizationToken = &lt;span class="user-type"&gt;Uri&lt;/span&gt;.UnescapeDataString(tokenVariable[1]);
}&lt;/pre&gt;
&lt;p&gt;The access token contains its expiry time (currently defaulting to 20 minutes), and you can keep using the same token over-and-over again until it expires. However, once the expiry time elapses you'll need to request a fresh token from the Access Control Service. Now we'll go ahead and create a WebClient to use for our calls to the service bus; we initialize it by correctly setting the Authorization header - you need this header to be present in any call you make to the service bus.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="user-type"&gt;WebClient&lt;/span&gt; webClient = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;WebClient&lt;/span&gt;();
webClient.Headers[&lt;span class="string"&gt;"Authorization"&lt;/span&gt;] = &lt;span class="string"&gt;"WRAP access_token=\""&lt;/span&gt; + authorizationToken + &lt;span class="string"&gt;"\""&lt;/span&gt;;&lt;/pre&gt;
&lt;h3&gt;Creating a new Queue&lt;/h3&gt;
&lt;p&gt;In the October CTP, we introduced the idea of Namespace Management: an explicit, RESTful interface to Create, Enumerate and Delete durable Service Bus entities (in the May CTP these are: Queues, Topics and Subscriptions). That concept carries through to the May CTP with just a couple of changes. You still use the established RESTful pattern (HTTP GET to retrieve/enumerate; HTTP PUT to create; HTTP DELETE to remove) to interact with Atom Feeds and Entries; we've simplified things by combining the Management Namespace (formerly https://&amp;lt;your-namespace&amp;gt;-mgmt.servicebus.appfabriclabs.com/) with the Service Namespace (still https://&amp;lt;your-namespace&amp;gt;.servicebus.appfabriclabs.com) though.&lt;/p&gt;
&lt;p&gt;A queue can exist anywhere in your service namespace - you create it by putting the description of the queue to a 'vacant' uri in your namespace. We'll need to specify the correct content type for the request (&lt;b&gt;Content-Type: application/atom+xml&lt;/b&gt;) then issue an &lt;b&gt;HTTP PUT&lt;/b&gt; to the Uri of the new queue (using the secure, https scheme) containing the Atom Entry which defines it:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="comment"&gt;// Note that the scheme is Https&lt;/span&gt;
&lt;span class="keyword"&gt;string&lt;/span&gt; serviceAddress = &lt;span class="string"&gt;"https://"&lt;/span&gt; + serviceNamespace + &lt;span class="string"&gt;".servicebus.appfabriclabs.com/"&lt;/span&gt;;

&lt;span class="keyword"&gt;string&lt;/span&gt; queueName = &lt;span class="string"&gt;"MyFirstQueue"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; putData = &lt;span class="string"&gt;@"&amp;lt;entry xmlns=""http://www.w3.org/2005/Atom""&amp;gt;
                     &amp;lt;title type=""text""&amp;gt;"&lt;/span&gt; + queueName + &lt;span class="string"&gt;@"&amp;lt;/title&amp;gt;
                     &amp;lt;content type=""application/xml""&amp;gt;
                       &amp;lt;QueueDescription xmlns:i=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""http://schemas.microsoft.com/netservices/2010/10/servicebus/connect"" /&amp;gt;
                     &amp;lt;/content&amp;gt;
                   &amp;lt;/entry&amp;gt;"&lt;/span&gt;;

&lt;span class="keyword"&gt;string&lt;/span&gt; queueAddress = serviceAddress + queueName;

webClient.Headers[&lt;span class="string"&gt;"Content-Type"&lt;/span&gt;] = &lt;span class="string"&gt;"application/atom+xml"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; response = webClient.UploadString(queueAddress, &lt;span class="string"&gt;"PUT"&lt;/span&gt;, putData);&lt;/pre&gt;
&lt;p&gt;The response to the request contains the Atom Entry for your newly created Queue (below) including all of the settable properties of the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.queuedescription.aspx"&gt;Queue Description&lt;/a&gt;. Updates to existing queues are not allowed, but you can include any of these properties in the Queue Description when you are creating a new queue.&lt;/p&gt;
&lt;pre class="xml code"&gt;&amp;lt;&lt;span class="element"&gt;entry&lt;/span&gt; &lt;span class="attribute"&gt;xmlns&lt;/span&gt;="http://www.w3.org/2005/Atom"&amp;gt;
  &amp;lt;&lt;span class="element"&gt;id&lt;/span&gt;&amp;gt;https://willpe.servicebus.appfabriclabs.com/MyFirstQueue&amp;lt;/&lt;span class="element"&gt;id&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class="element"&gt;title&lt;/span&gt; &lt;span class="attribute"&gt;type&lt;/span&gt;="text"&amp;gt;&lt;span class="element-content"&gt;MyFirstQueue&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;title&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class="element"&gt;published&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;2011-05-17T20:26:00Z&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;published&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class="element"&gt;updated&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;2011-05-17T20:26:00Z&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;updated&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class="element"&gt;author&lt;/span&gt;&amp;gt;
    &amp;lt;&lt;span class="element"&gt;name&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;willpe&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;name&lt;/span&gt;&amp;gt;
  &amp;lt;/&lt;span class="element"&gt;author&lt;/span&gt;&amp;gt;
  &amp;lt;&lt;span class="element"&gt;link&lt;/span&gt; &lt;span class="attribute"&gt;rel&lt;/span&gt;="self" &lt;span class="attribute"&gt;href&lt;/span&gt;="https://willpe.servicebus.appfabriclabs.com/MyFirstQueue"/&amp;gt;
  &amp;lt;&lt;span class="element"&gt;content&lt;/span&gt; &lt;span class="attribute"&gt;type&lt;/span&gt;="application/xml"&amp;gt;
    &amp;lt;&lt;span class="element"&gt;QueueDescription&lt;/span&gt; &lt;span class="attribute"&gt;xmlns&lt;/span&gt;="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect" &lt;span class="attribute"&gt;xmlns:i&lt;/span&gt;="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
      &amp;lt;&lt;span class="element"&gt;LockDuration&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;PT30S&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;LockDuration&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;MaxQueueSizeInBytes&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;104857600&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;MaxQueueSizeInBytes&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;RequiresDuplicateDetection&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;false&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;RequiresDuplicateDetection&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;RequiresSession&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;false&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;RequiresSession&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;DefaultMessageTimeToLive&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;P10675199DT2H48M5.4775807S&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;DefaultMessageTimeToLive&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;DeadLetteringOnMessageExpiration&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;false&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;DeadLetteringOnMessageExpiration&lt;/span&gt;&amp;gt;
      &amp;lt;&lt;span class="element"&gt;DuplicateDetectionHistoryTimeWindow&lt;/span&gt;&amp;gt;&lt;span class="element-content"&gt;PT10M&lt;/span&gt;&amp;lt;/&lt;span class="element"&gt;DuplicateDetectionHistoryTimeWindow&lt;/span&gt;&amp;gt;
    &amp;lt;/&lt;span class="element"&gt;QueueDescription&lt;/span&gt;&amp;gt;
  &amp;lt;/&lt;span class="element"&gt;content&lt;/span&gt;&amp;gt;
&amp;lt;/&lt;span class="element"&gt;entry&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;h3&gt;Sending a Message to the Queue&lt;/h3&gt;
&lt;p&gt;Sending a message using the REST endpoint is really simple: just HTTP Post the body of the message to the Queue's incoming messages uri with the Authorization header in place (specifying the correct content type for the message's body):&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="keyword"&gt;string&lt;/span&gt; messageBody = "Hello World!";
&lt;span class="keyword"&gt;string&lt;/span&gt; sendAddress = serviceAddress + queueName + &lt;span class="string"&gt;"/Messages"&lt;/span&gt;;

webClient.Headers[&lt;span class="string"&gt;"Content-Type"&lt;/span&gt;] = &lt;span class="string"&gt;"text/plain"&lt;/span&gt;;
webClient.UploadString(sendAddress, &lt;span class="string"&gt;"POST"&lt;/span&gt;, messageBody);&lt;/pre&gt;
&lt;h3&gt;Receiving a Message from the Queue&lt;/h3&gt;
&lt;p&gt;Messages can be received with either &lt;b&gt;Peek Lock&lt;/b&gt; or &lt;b&gt;Receive And Delete&lt;/b&gt; semantics; both are supported via REST, but for now we'll use Receive and Delete. Receiving in this mode is as simple as issuing a HTTP Delete request to the Head of the Message Queue with a receive timeout:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="keyword"&gt;string&lt;/span&gt; receiveAddress = serviceAddress + queueName + &lt;span class="string"&gt;"/Messages/Head?timeout=30"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; receivedMessageBody = webClient.UploadString(receiveAddress, &lt;span class="string"&gt;"DELETE"&lt;/span&gt;, &lt;span class="keyword"&gt;string&lt;/span&gt;.Empty);&lt;/pre&gt;
&lt;p&gt;The receivedMessageBody contains the plain text sent earlier (neat!) - you can also take a look at the Response Headers to find more properties of the message:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span class="keyword"&gt;X-MS-MESSAGE-ID&lt;/span&gt;: &lt;span class="string"&gt;d78afc3299b54ab2bd0e97b183ab1f77&lt;/span&gt;
&lt;span class="keyword"&gt;X-MS-DELIVERY-COUNT&lt;/span&gt;: &lt;span class="string"&gt;0&lt;/span&gt;
&lt;span class="keyword"&gt;X-MS-SEQUENCE-NUMBER&lt;/span&gt;: &lt;span class="string"&gt;2&lt;/span&gt;
&lt;span class="keyword"&gt;X-MS-SIZE&lt;/span&gt;: &lt;span class="string"&gt;12&lt;/span&gt;
&lt;span class="keyword"&gt;Content-Type&lt;/span&gt;: &lt;span class="string"&gt;text/plain&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;Deleting the Queue&lt;/h3&gt;
&lt;p&gt;Finally, it's time to delete the queue; this is acheived by a simple HTTP Delete to the Queue's Address:&lt;/p&gt;
&lt;pre class="code"&gt;webClient.UploadString(queueAddress, &lt;span class="string"&gt;"DELETE"&lt;/span&gt;, &lt;span class="keyword"&gt;string&lt;/span&gt;.Empty);&lt;/pre&gt;
&lt;p&gt;So, there we have it - a quick introduction to using the new REST features of AppFabric Service Bus Messaging. There's lots more you can do, and I'll be covering more of the features next week but it's never too early to send the team your feedback - visit the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/appfabricctp/"&gt;AppFabric CTP Forum&lt;/a&gt; and tell us what you think!&lt;/p&gt;
&lt;p&gt;In particular, we'd love to hear from you around how you'll be using HTTP in Applications you build:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Which platforms and devices are you considering using Service Bus from? &lt;/li&gt;
&lt;li&gt;Which feature(s) of the Service Bus are most important for us to support over HTTP to make your applications successful? &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Take the &lt;a href="http://www.surveygizmo.com/s/547134/service-bus-survey-5-18-2011"&gt;HTTP Feature Survey&lt;/a&gt; to help shape the future of Service Bus!&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10166056" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/AppFabric/">AppFabric</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Service+Bus/">Service Bus</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/REST/">REST</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Messaging/">Messaging</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Http/">Http</category></item><item><title>Getting Access Control Service Tokens via HTTP</title><link>http://blogs.msdn.com/b/willpe/archive/2011/05/12/getting-access-control-service-tokens-via-http.aspx</link><pubDate>Wed, 11 May 2011 23:59:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10163587</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10163587</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10163587</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2011/05/12/getting-access-control-service-tokens-via-http.aspx#comments</comments><description>  &lt;p&gt;Some people like to say that French is the language of love. Others - mainly those with more interest in slipping you a network stack than an afrodisiac - will tell you that HTTP is the protocol equivalent. The AppFabric Service Bus loves HTTP too, and it also loves Security: in this post, I'm going to show you how to get - and understand - a security token from the Access Control Service via HTTP.&lt;/p&gt;&lt;b&gt;Claims Based Auth 101&lt;/b&gt;  &lt;p&gt;To gain access to the service bus, you need to present a &lt;a href="http://wrap-wg.googlegroups.com/attach/38c3c90481d6065c/WRAP-v0.9.7.1.pdf?view=1&amp;part;=4"&gt;WRAP Access Token&lt;/a&gt; [PDF] in the HTTP Authorization Header for each of your calls. The content for that header is acquired from the access control service by presenting an assertion (like a signed Simple Web Token or a Username and Password pair) as a simple HTTP request; the response contains a set of claims (like who you are, where the token came from, how long the token lasts and which permissions the bearer has) which are signed to ensure authenticity.&lt;/p&gt; &lt;p&gt;Before we get started, you'll want to head over to the &lt;a href="https://portal.appfabriclabs.com/"&gt;AppFabric Labs Portal&lt;/a&gt;. If you aren't signed up, take a moment to create a free account - once you're in click on the Service Bus node on the left and click the 'View' button on the right marked 'Default Issuer'. Note down the details (Issuer Name/Key) from here because you'll need them later.&lt;/p&gt;&lt;b&gt;Service Namespaces, Issers and Keys&lt;/b&gt;  &lt;p&gt;When you create a new Service Bus Namespace, a default identity is established in the namespace's associated Access Control Service namespace. This identity has both Shared Secret and Password credentials available - you can see those credentials by logging in to Access Control Management at &lt;b&gt;https://&lt;i&gt;[Your-Service-Namespace]&lt;/i&gt;-sb.accesscontrol.appfabriclabs.com/v2/mgmt/web/ServiceIdentity&lt;/b&gt; and clicking on 'owner' ('owner' is the name of the default service identity created when your account was provisioned). When your account is provisioned, the same key is used for both the Issuer Password credential and the Issuer Secret Key credential - this won't always be true as you create more issuers, passwords and secret keys: you don't need to have both a password and a secret key for an issuer, and if you do have both they don't need to be the same.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span class="keyword"&gt;string&lt;/span&gt; serviceNamespace = &lt;span class="string"&gt;"contoso"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; issuerName  = &lt;span class="string"&gt;"owner"&lt;/span&gt;;
&lt;span class="keyword"&gt;string&lt;/span&gt; issuerPassword = &lt;span class="string"&gt;"&amp;lt;Enter Your Key Here&amp;gt;"&lt;/span&gt;;&lt;/pre&gt;
&lt;p&gt;You can request a token from ACS using either the password or the shared secret - here is how they differ:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A &lt;b&gt;Username and Password&lt;/b&gt; are presented to ACS as credentials, if they match the stored values, an auth. token is returned. 
&lt;li&gt;A &lt;b&gt;Shared Secret&lt;/b&gt; is used to sign a set of claims which are presented to ACS. If the signature is valid for the presented claims, an auth. token is returned. &lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;Regardless of how you request a token, you'll need to use the WRAPv0.9 ACS Endpoint for your Namespace (note the &lt;b&gt;&lt;u&gt;'-sb'&lt;/u&gt;&lt;/b&gt; suffix attached to the service namespace) and the Uri for your Service Bus service namespace &lt;b&gt;&lt;u&gt;using the HTTP:// scheme&lt;/u&gt;&lt;/b&gt; (even though, for security purposes, the service bus is only accessible over https, tokens must be requested for http). &lt;/p&gt;&lt;pre class="code"&gt;&lt;span class="keyword"&gt;string&lt;/span&gt; acsEndpoint = &lt;span class="string"&gt;"https://"&lt;/span&gt; + serviceNamespace + &lt;span class="string"&gt;"-sb.accesscontrol.appfabriclabs.com/WRAPv0.9/"&lt;/span&gt;; 
&lt;span class="keyword"&gt;string&lt;/span&gt; relyingPartyAddress = &lt;span class="string"&gt;"http://"&lt;/span&gt; + serviceNamespace + &lt;span class="string"&gt;".servicebus.appfabriclabs.com/"&lt;/span&gt;;&lt;/pre&gt;

&lt;b&gt;Method 1: Acquiring a Token with a Username and Password&lt;/b&gt; Getting a token using a username and password is really simple - just post a collection of values to the ACS Endpoint including the Relying Party Address ('wrap_scope'), the Issuer Name ('wrap_name') and the Issuer Password ('wrap_password'). The collection of response variables includes the token (but we'll get to that later!): &lt;pre class="code"&gt;&lt;span class="user-type"&gt;NameValueCollection&lt;/span&gt; postData = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;NameValueCollection&lt;/span&gt;
    {
        { &lt;span class="string"&gt;"wrap_scope"&lt;/span&gt;, relyingPartyAddress },
        { &lt;span class="string"&gt;"wrap_name"&lt;/span&gt;, issuerName },
        { &lt;span class="string"&gt;"wrap_password"&lt;/span&gt;, issuerPassword },
    };

&lt;span class="user-type"&gt;WebClient&lt;/span&gt; webClient = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;WebClient&lt;/span&gt;();
&lt;span class="keyword"&gt;byte&lt;/span&gt;[] responseBuffer = webClient.UploadValues&lt;/span&gt;(acsEndpoint, "POST", postData);
&lt;span class="keyword"&gt;string&lt;/span&gt; response = &lt;span class="user-type"&gt;Encoding&lt;/span&gt;.UTF8.GetString(responseBuffer);&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;Method 2: Acquiring a Token with a Shared Secret&lt;/b&gt;&lt;/p&gt;The process with a Shared Secret is similar but has another step - we'll still post the Relying Party Address ('wrap_scope'), but instead of posting a username and password we'll send a Signed Simple Web Token ('wrap_assertion') along with a Token Format Identifier ('wrap_assertion_format', equal to 'SWT'). The token is simply a string containing the Issuer Name (in the format, Issuer={0}) signed with a HMACSHA256: 
&lt;pre class="code"&gt;
&lt;span class="keyword"&gt;byte&lt;/span&gt;[] issuerSecretBytes = &lt;span class="user-type"&gt;Convert&lt;/span&gt;.FromBase64String(issuerSecret);
&lt;span class="keyword"&gt;string&lt;/span&gt; token = &lt;span class="string"&gt;&amp;quot;Issuer=&amp;quot;&lt;/span&gt; + &lt;span class="user-type"&gt;Uri&lt;/span&gt;.EscapeDataString(issuerName);
&lt;span class="keyword"&gt;string&lt;/span&gt; signature;

&lt;span class="keyword"&gt;using&lt;/span&gt; (&lt;span class="user-type"&gt;HMACSHA256&lt;/span&gt; sha256 = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;HMACSHA256&lt;/span&gt;(issuerSecretBytes))
{
    &lt;span class="keyword"&gt;byte&lt;/span&gt;[] signatureBytes = sha256.ComputeHash(&lt;span class="user-type"&gt;Encoding&lt;/span&gt;.UTF8.GetBytes(token));
    signature = &lt;span class="user-type"&gt;Convert&lt;/span&gt;.ToBase64String(signatureBytes);
}

&lt;span class="keyword"&gt;string&lt;/span&gt; signedToken = token + &lt;span class="string"&gt;&amp;quot;&amp;HMACSHA256=&amp;quot;&lt;/span&gt; + Uri.EscapeDataString(signature);
&lt;/pre&gt;
&lt;p&gt;
With the signed token computed, we construct a collection of post data and send it as before:
&lt;/p&gt;
 &lt;pre class="code"&gt;&lt;span class="user-type"&gt;NameValueCollection&lt;/span&gt; postData = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;NameValueCollection&lt;/span&gt;
    {
        { &lt;span class="string"&gt;"wrap_scope"&lt;/span&gt;, relyingPartyAddress },
        { &lt;span class="string"&gt;"wrap_assertion_format"&lt;/span&gt;, &lt;span class="string"&gt;"SWT"&lt;/span&gt;},
        { &lt;span class="string"&gt;"wrap_assertion"&lt;/span&gt;, signedToken },
    };

&lt;span class="user-type"&gt;WebClient&lt;/span&gt; webClient = &lt;span class="keyword"&gt;new&lt;/span&gt; &lt;span class="user-type"&gt;WebClient&lt;/span&gt;();
&lt;span class="keyword"&gt;byte&lt;/span&gt;[] responseBuffer = webClient.UploadValues&lt;/span&gt;(acsEndpoint, "POST", postData);
&lt;span class="keyword"&gt;string&lt;/span&gt; response = &lt;span class="user-type"&gt;Encoding&lt;/span&gt;.UTF8.GetString(responseBuffer);&lt;/pre&gt;

&lt;p&gt;
Now that we've seen how to get a token (in one of two excitingly similar ways) let's take a look at the response.
&lt;/p&gt;

&lt;b&gt;Understanding the Token&lt;/b&gt;
&lt;p&gt;The response is formatted as a Http Form (name1=value1&amp;name2=value2) like this (the sensitive details have been scrubbed to protect the innocent):&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;span class="keyword"&gt;wrap_access_token&lt;/span&gt;=
&lt;span class="string"&gt;net.windows.servicebus.action%3dListen%252cManage%252cSend%26http%253a%252f%252fschemas.microsoft.com%252faccesscontrolservice%252f2010%252f07%252fclaims%252fidentityprovider%3dhttps%253a%252f%252fwillpe-blog-sb.accesscontrol.appfabriclabs.com%252f%26Audience%3dhttp%253a%252f%252fwillpe-blog.servicebus.appfabriclabs.com%252f%26ExpiresOn%3d1305157180%26Issuer%3dhttps%253a%252f%252fwillpe-blog-sb.accesscontrol.appfabriclabs.com%252f%26HMACSHA256%3daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%253d&lt;/span&gt;
&amp;amp;&lt;span class="keyword"&gt;wrap_access_token_expires_in&lt;/span&gt;=
&lt;span class="string"&gt;1199&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The WRAP Access Token is the piece of this response that we need. It's Url Encoded (i.e. it can be decoded using Uri.UnescapeDataString):&lt;/p&gt;
&lt;pre class="code"&gt;
&lt;span class="keyword"&gt;net.windows.servicebus.action&lt;/span&gt;=Listen,Manage,Send&lt;/span&gt;
&amp;&lt;span class="keyword"&gt;http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider&lt;/span&gt;=&lt;span class="string"&gt;https://willpe-blog-sb.accesscontrol.appfabriclabs.com/&lt;/span&gt;
&amp;&lt;span class="keyword"&gt;Audience&lt;/span&gt;=&lt;span class="string"&gt;http://willpe-blog.servicebus.appfabriclabs.com/&lt;/span&gt;
&amp;&lt;span class="keyword"&gt;ExpiresOn&lt;/span&gt;=&lt;span class="string"&gt;1305157806&lt;/span&gt;
&amp;&lt;span class="keyword"&gt;Issuer&lt;/span&gt;=&lt;span class="string"&gt;https://willpe-blog-sb.accesscontrol.appfabriclabs.com/&lt;/span&gt;
&amp;&lt;span class="keyword"&gt;HMACSHA256&lt;/span&gt;=&lt;span class="string"&gt;aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;The token contains 5 claims and a signature:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;net.windows.servicebus.action&lt;/b&gt;: The permissions this token grants (in this case, Listen, Send and Manage)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider&lt;/b&gt;: The authority that actually identified the user (ACS, Active Directory, Facebook, etc)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Audience&lt;/b&gt;: The url that this token applies to&lt;/li&gt;
&lt;li&gt;&lt;b&gt;ExpiresOn&lt;/b&gt;: The time that this token is valid until; expressed as a unix file time (that is the number of seconds past January 1, 1970 at 12:00:00 am (UTC))&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Issuer&lt;/b&gt;: The Security Token Service which issued this security token (ACS)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;HMACSHA256&lt;/b&gt;: The token signature&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In your application, you can use these values to figure out when to renew a token, how the user was authenticated and which actions the user is permitted to perform.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10163587" width="1" height="1"&gt;</description></item><item><title>Some Thoughts on Test Frameworks</title><link>http://blogs.msdn.com/b/willpe/archive/2011/02/05/some-thoughts-on-test-frameworks.aspx</link><pubDate>Sat, 05 Feb 2011 00:53:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10125123</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10125123</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10125123</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2011/02/05/some-thoughts-on-test-frameworks.aspx#comments</comments><description> &lt;p&gt;It might not be the sexiest of topics, but building, consuming, extending and debugging Test Frameworks is a large part of any &lt;a href="http://microsoftjobsblog.com/test/"&gt;SDET&lt;/a&gt;'s day. Traditional wisdom teaches us to write abstraction layers - often many of them - to shield test cases from changes in the system under test: in API testing this often means creating scenario-focussed wrappers over the product; when testing UI this might mean adding layers of automation on top of the actual controls a user would interact with. We generally refer to these abstractions as Test Frameworks - they allow us to write test cases at a much higher level and reduce the maintenance burden of fixing test cases as a system under development inevitably changes.&lt;/p&gt; &lt;p&gt;Recently when struggling through a set of changes to one such framework, it struck me that we pour a lot of time and effort into these frameworks: would life be simpler, tests better and productivity higher without our obviously needed framework-friend? Maybe.&lt;/p&gt; &lt;p&gt;Firstly- we're building these frameworks to &lt;b&gt;hide changes in the system under test&lt;/b&gt;. Aren't changes in the product exactly one of the things we'd like to be detecting? In simple tests and certainly tests of APIs, small changes which break tests might be pretty relevant for a feature tester to look at, but in higher-level, end-to-end scenarios, we're probably better off having these changes hidden. So, if our end-to-end, high level scenarios benefit from frameworks, what level of investment do we want to make in them? It probably depends on what portion of the test plan is comprised of end-to-end tests.&lt;/p&gt; &lt;p&gt;Another use of frameworks is to hide complexity in the product itself - consider an API where we need to instantiate an object, make a method call to initialize it, then execute an operation on it in order to achieve some customer scenario: &lt;pre class="code"&gt;var iceCreamMachine = iceCreamTruck.CreateIceCreamMachine(Flavors.Chocolate);
iceCreamMachine.TurnOn();
var treat = iceCreamMachine.MakeIceCream();&lt;/pre&gt;
Since spreading code like this all over our test cases is going to get messy, we add this &lt;b&gt;Helper Method&lt;/b&gt; to the test framework:
&lt;pre class="code"&gt;T MakeTreat&lt;t&gt;(IceCreamTruck truck, Flavors flavor) where T : Treat...&lt;/t&gt;&lt;/pre&gt;
It's great, it works and it makes our test code look a lot nicer. There's certainly no reason not to do this, but ask yourself this: &lt;b&gt;If &lt;i&gt;I&lt;/i&gt; want this helper method to make writing my code easier and cleaner, wouldn't &lt;i&gt;my customers&lt;/i&gt; want it too?&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;We can add these abstractions and wrappers because we ignore or assume details: the system under test often allows a great deal of flexibility, often more than is required for the test cases in question. As the suite grows, more of the products 'knobs and levers' are altered by tests, meaning that more options creep into our wrappers too: sometimes this is a 'helper' class with more properties than the class it's helping you to use; sometime's its a 'helper' method with 15 oddly named parameters. Often - despite the best intentions of the framework's original designers - it becomes more complicated than the product it tests and is always less well documented.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;I came to a basic conclusion: &lt;b&gt;Test Frameworks are fun to write, but that doesn't always mean it's the right thing to do!&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;When dealing with the sordid topic of abstractions, it's worthwhile to remember a 1987 essay by Frederick P. Brooks Jr., &lt;a href="http://virtualschool.edu/mon/SoftwareEngineering/BrooksNoSilverBullet.html"&gt;No Silver Bullet&lt;/a&gt;, in which we're all reminded that &lt;i&gt;"The complexity of software is an essential property, not an accidental one. Hence, descriptions of a software entity that abstract away its complexity often abstract away its essence."&lt;/i&gt; - translating this roughly into test parlance: &lt;b&gt;Avoid abstracting away the thing you're trying to test&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;In general development, any learned software engineer will tell you that readability of code is really important: for every time a line of code is written, it is read many, many times. Optimize for the time spent reading, not the time spent writing. In test, I'd like to propose something similar: &lt;b&gt;for every time a test case is written, it will be read and maintained several times, but executed and investigated an order of magnitude more.&lt;/b&gt; Maybe we should start optimizing our tests for the times that they fail. After all, a test case is surely at its most useful when failing, since it is hinting at a defect in the product being tested. As soon as a test fails, I usually run through three steps of analysis:
&lt;ol&gt;
	&lt;li&gt;What does this test &lt;b&gt;actually do&lt;/b&gt;?&lt;/li&gt;
	&lt;li&gt;Is the framework working property? &lt;b&gt;Is this a framework issue?&lt;/b&gt;&lt;/li&gt; 
	&lt;li&gt;What do the &lt;b&gt;repro steps&lt;/b&gt; for this bug look like?&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;Often, the exception actually thrown by the test case is fairly general - it's usually coming from somewhere deep in the test framework and doesn't give much clue to what's actually happened or what the expected outcome of the failing operation was supposed to be. Consider these two exception messages, this from a test framework:&lt;/p&gt;
&lt;pre class="code"&gt;The expected 'TastesIckyException' was not thrown.&lt;/pre&gt;
&lt;p&gt;... and this one from a test case:
&lt;pre class="code"&gt;Calling MakeIceCream with custom composite flavor 'Mango' and 'Bacon' should fail, 
because mixing sweet and savoury ice creams together is not allowed.&lt;/pre&gt;
&lt;p&gt;There's really not much difference between those two messages, but the second tells you a little more: the test was trying to use custom flavors; the test was using 'composite' flavors; the test was not expecting Mango and Bacon to be a valid flavor. You instantly have some idea about what the test is supposed to be doing and where the failure(s) might be.&lt;/p&gt;
&lt;p&gt;In the first case, above, you'd need to dig into the framework to figure out what's going on - is the wrong overload of MakeIceCream() being called? Is the IceCreamMachine correctly configured with Mango and Bacon? Is it the right type of machine? Consider a second test case that looks like this:&lt;/p&gt;
&lt;pre class="code"&gt;var flavors = new CompositeFlavor(Flavors.Mango, Flavors.Bacon);
var iceCreamMachine = iceCreamTruck.CreateIceCreamMachine(flavors);
iceCreamMachine.TurnOn();
try
{
    var treat = iceCreamMachine.MakeIceCream();
    Fail("Calling MakeIceCream with the custom composite...")
}
catch (TastesIckyException e)
{
    Log.Expected(e);
}&lt;/pre&gt;
&lt;p&gt;It's pretty obvious what's going on here, and has a nice side-effect. The test method describes the repro steps. A dev can read these and see:
&lt;ul&gt;
	&lt;li&gt;We're using a CompositeFlavor&lt;/li&gt;
	&lt;li&gt;We're passing it into CreateIceCreamMachine&lt;/li&gt;
	&lt;li&gt;We call an overload of MakeIceCream() with no parameters&lt;/li&gt;
	&lt;li&gt;We expected a TastesIckyException&lt;/li&gt;
	&lt;li&gt;The problem is that sweet and savory can't be used together in an ice cream flavor&lt;/li&gt;
&lt;/ul&gt;
When your test case looks like your repro steps would, a developer can easily determine what the problem is, where it might be and what the expected outcome is; You can easily figure out what the expected outcome of the test is and why it's failing; Both of you save time.&lt;/p&gt;
&lt;p&gt;Obviously, this is a fairly trivial - and specific - example. However, it's lead me to think about three things when writing new tests:
&lt;ol&gt;
	&lt;li&gt;Write tests which look like the repro steps you'd want to hand off to a developer;&lt;/li&gt;
	&lt;li&gt;Explicitly encode the Expected and Actual outcomes of your test directly into the test case;&lt;/li&gt;
	&lt;li&gt;File bugs about the 'Helper Methods' you need to add to make using the product more pleasant - your customers will thank you!&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;And lastly: it goes without saying that re-use isn't a bad thing, neither are common libraries or frameworks. We'll always benefit from common code, abstraction and toolkits - just consider how, where and why you're using them.
&lt;/p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10125123" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Test/">Test</category></item><item><title>Getting Started with Service Bus v2 (October CTP) - Connection Points</title><link>http://blogs.msdn.com/b/willpe/archive/2010/11/01/getting-started-with-service-bus-v2-october-ctp-connection-points.aspx</link><pubDate>Mon, 01 Nov 2010 22:13:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10084346</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10084346</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10084346</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2010/11/01/getting-started-with-service-bus-v2-october-ctp-connection-points.aspx#comments</comments><description>&lt;p&gt;Last week at PDC we released a Community Technology Preview (CTP) of a new version of &lt;a href="http://portal.appfabriclabs.com/"&gt;Windows Azure AppFabric&lt;/a&gt; Service Bus. You can download the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=d89640fc-c552-446e-aead-b1e0d940f31b&amp;amp;displaylang=en"&gt;SDK, Samples and Help&lt;/a&gt; on the Microsoft Download Center. There’s plenty new in this release and the first is the notion of &lt;strong&gt;Explicit Connection Point Management&lt;/strong&gt;. In v1 whenever you started up a service and relayed it through the cloud over service bus we just quietly cooperated – this seems like a great idea until you think about a couple of advanced scenarios: Firstly: what happens when your service is offline but a sender (client) tries to connect to it? Well, we don’t know if the service is offline or the address is wrong (and there’s no way to differentiate); there’s no way to determine what’s a valid service connection point and what isn’t. There’s also no way to specify metadata about the service that connects (this is a HTTP endpoint, this endpoint is only Oneway). Also, you might have noticed that we added support for Anycast in v2 – how can you determine which connection points are Unicast (one listener/server and many senders/clients) and which are unicast (many load-balanced listeners and many clients)? That’s what connection points are for.&lt;/p&gt;  &lt;p&gt;A Connection Point defines the metadata for a Service Bus connection. This includes the &lt;strong&gt;Shape&lt;/strong&gt; (Duplex, RequestReply, Http or Oneway) and &lt;strong&gt;Maximum Number of Listeners&lt;/strong&gt; and the &lt;strong&gt;Runtime Uri&lt;/strong&gt; which acts as the service endpoint. Connection Points are managed as an Atom Feed using standard REST techniques. You’ll find the feed at the Connection Point Management Uri (&lt;a href="https://&amp;lt;YourServiceNamespace&amp;gt;-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints"&gt;-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints&amp;quot;&amp;gt;https://&amp;lt;YourServiceNamespace&amp;gt;-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints&lt;/a&gt;)&lt;sup&gt;1&lt;/sup&gt; and it’ll look at little bit like this:&lt;/p&gt;  &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;feed&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;http://www.w3.org/2005/Atom&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;text&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;ConnectionPoints&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;subtitle&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;text&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;This is the list of ConnectionPoints currently available&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;subtitle&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;https://willpe-blog-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;updated&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;2010-11-01T20:53:53Z&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;updated&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;generator&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;Microsoft Windows Azure AppFabric - Service Bus&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;generator&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;link&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;rel&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;self&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;br /&gt;        &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;href&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;https://willpe-blog-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;entry&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;https://willpe-blog-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints(TestConnectionPoint)&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;text&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&lt;strong&gt;TestConnectionPoint&lt;/strong&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;published&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;2010-11-01T20:51:11Z&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;published&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;updated&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;2010-11-01T20:51:11Z&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;updated&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;link&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;rel&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;self&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;br /&gt;          &lt;/font&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;href&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;https://willpe-blog-mgmt.servicebus.appfabriclabs.com/Resources/ConnectionPoints(TestConnectionPoint)&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;link&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;rel&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;alternate&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;&lt;br /&gt;          &lt;strong&gt;href&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;sb://willpe-blog.servicebus.appfabriclabs.com/services/testconnectionpoint&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;content&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;application/xml&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;strong&gt;&amp;lt;&lt;/strong&gt;&lt;/span&gt;&lt;/font&gt;&lt;strong&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;ConnectionPoint&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;xmlns:xsd&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;http://www.w3.org/2001/XMLSchema&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;xmlns:xsi&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;=&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;quot;&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;MaxListeners&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;2&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;MaxListeners&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;ChannelShape&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;RequestReply&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;ChannelShape&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;ConnectionPoint&lt;/font&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;content&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;entry&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font style="font-size: "&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;feed&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: " color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;

&lt;p&gt;Writing some code to get your list of connection points is easy – in the rest of this post, I’ll show you how to (very simply) List, Create and Delete connection points. Before getting started, make sure that you’ve installed the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=d89640fc-c552-446e-aead-b1e0d940f31b&amp;amp;displaylang=en"&gt;October 2010 Windows Azure AppFabric SDK&lt;/a&gt; then create a new .Net Framework 4.0 (Full) Console Application in Visual Studio 2010.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Add a reference to the &lt;strong&gt;Microsoft.ServiceBus.Channels&lt;/strong&gt; assembly (its in the GAC, or at &lt;em&gt;C:\Program Files\Windows Azure AppFabric SDK\V2.0\Assemblies\Microsoft.ServiceBus.Channels.dll&lt;/em&gt; if you need to find it on disk) &lt;/li&gt;

  &lt;li&gt;Add 3 string constant containing your Service Namespace, Default Issuer Name and Default Issuer Key. You can get this information over at the &lt;a href="http://portal.appfabriclabs.com/"&gt;Windows Azure AppFabric Portal&lt;/a&gt;: 

    &lt;br /&gt;

    &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&amp;#160;&amp;#160; private&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; serviceNamespace = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;YourServiceNamespace&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; 
            &lt;br /&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&amp;#160;&amp;#160; private&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; username = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;owner&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; 
            &lt;br /&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;#160;&amp;#160;&amp;#160; private&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;const&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; password = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;base64base64base64base64base64base64base64==&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;; 
            &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;Now define the hostname of your service bus management service (you can find this in the &lt;a href="http://portal.appfabriclabs.com/"&gt;portal&lt;/a&gt;, too): 

    &lt;br /&gt;

    &lt;br /&gt;&lt;font size="2"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;readonly&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ManagementHostName = serviceNamespace + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;-mgmt.servicebus.appfabriclabs.com&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 

      &lt;br /&gt;&lt;/font&gt;&lt;!--endfragment--&gt;&lt;/!--endfragment--&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Access to Service Bus Management is controlled by the Access Control Service. You’ll need to present the ‘&lt;em&gt;net.windows.servicebus.action&lt;/em&gt;’ claim with a value ‘&lt;em&gt;Manage&lt;/em&gt;’ in order to have permission to Create, Read and Delete connection points. The default issuer (owner) is configured to have this permission by default when you provision a new account.&lt;/p&gt;

&lt;p&gt;We’ll need to go ahead and get a Simple Web Token from the Access Control Service for our request. Note that, by default, the realm (relying party address) used for service bus management has the &lt;strong&gt;http&lt;/strong&gt; scheme: you must retrieve a token for the management service using a Uri with the default port and http scheme even though you will in fact connect to the service over https:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Get an auth token from ACS&lt;sup&gt;2&lt;/sup&gt; for the management service’s realm (remember, this must specify an &lt;strong&gt;http&lt;/strong&gt; scheme): 

    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;    string&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt; authToken = GetAuthToken(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;http://&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + ManagementHostName + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;));&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Add the token to the Authorization Header of a new WebClient and download the feed: – note that here we specify &lt;strong&gt;https&lt;/strong&gt;)&amp;#160; &lt;br /&gt;

    &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; client = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;()) 
            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; { 

            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.Headers.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;HttpRequestHeader&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Authorization, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;WRAP access_token=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + authToken + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;); 
            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; feedUri = &lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + ManagementHostName + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;/Resources/ConnectionPoints&amp;quot;;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; 
            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; connectionPoints = client.DownloadString(feedUri&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;); 
            &lt;br /&gt;

            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Console&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;.WriteLine(connectionPoints); 
          &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Compile and run the app to see your current connection points (probably none). Now lets go ahead and create a Connection Point – to do this we just Post an Atom entry to the ConnectionPoint Management service. You can achieve this using classes from the System.ServiceModel.Syndication namespace&lt;sup&gt;3&lt;/sup&gt; but for clarity and simplicity we’ll stick to just using a big old block of xml encoded as a string – its not pretty this way, but it gets the job done!&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Define the properties of the new Connection Point – you need to specify a name (alphanumeric), the maximum number of listeners, a channel shape (Duplex, Http, Oneway or RequestReply) and the endpoint address (sometimes called a Runtime Uri) for the service: 
    &lt;br /&gt;

    &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; connectionPointName = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;TestConnectionPoint&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;; 
            &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; maxListeners = 2; 
            &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; channelShape = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;RequestReply&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;; 
            &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; endpointAddress = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;ServiceBusEnvironment&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.CreateServiceUri( 
            &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&amp;quot;sb&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, serviceNamespace, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;/services/TestConnectionPoint&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;); 
            &lt;br /&gt;

            &lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/li&gt;

  &lt;li&gt;Now, go ahead and define the new Atom Entry for the connection point. Note how the name is set as the entry’s title and the endpoint address is set as an alternate link for the entry. 
    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; entry = &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#a31515"&gt;&lt;span style="color: "&gt;@&amp;quot;&amp;lt;entry xmlns=&amp;quot;&amp;quot;http://www.w3.org/2005/Atom&amp;quot;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;id&amp;gt;uuid:04d8d317-511c-4946-bc1d-6f49b6f66385;id=3&amp;lt;/id&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;title type=&amp;quot;&amp;quot;text&amp;quot;&amp;quot;&amp;gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt; + connectionPointName + &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#a31515"&gt;&lt;span style="color: "&gt;@&amp;quot;&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;link rel=&amp;quot;&amp;quot;alternate&amp;quot;&amp;quot; href=&amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt; + endpointAddress + &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#a31515"&gt;&lt;span style="color: "&gt;@&amp;quot;&amp;quot;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;updated&amp;gt;2010-11-01T20:44:08Z&amp;lt;/updated&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;content type=&amp;quot;&amp;quot;application/xml&amp;quot;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ConnectionPoint xmlns:i=&amp;quot;&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;quot; xmlns=&amp;quot;&amp;quot;&amp;quot;&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;MaxListeners&amp;gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt; + maxListeners + &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#a31515"&gt;&lt;span style="color: "&gt;@&amp;quot;&amp;lt;/MaxListeners&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;ChannelShape&amp;gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt; + channelShape + &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#a31515"&gt;&lt;span style="color: "&gt;@&amp;quot;&amp;lt;/ChannelShape&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/ConnectionPoint&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/content&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: "&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/entry&amp;gt;&amp;quot;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Create a HttpWebRequest, add the ACS Auth Token, set the Http Method to Post and configure the content type as ‘&lt;em&gt;application/atom+xml&lt;/em&gt;’: 

    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;    var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; request = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;HttpWebRequest&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Create(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + ManagementHostName + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;/Resources/ConnectionPoints&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;HttpWebRequest&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; request.Headers.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;HttpRequestHeader&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Authorization, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;WRAP access_token=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + authToken + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; request.ContentType = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;application/atom+xml&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; request.Method = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;POST&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Finally, write the new atom entry to the request stream and retrieve the response. You’ll discover an atom entry describing your newly created connection point in that response: 
    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; writer = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;StreamWriter&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;(request.GetRequestStream()))&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; writer.Write(entry);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebResponse&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; response = request.GetResponse();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Stream&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt; responseStream = response.GetResponseStream();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; connectionPoint = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;StreamReader&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;(responseStream).ReadToEnd();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Console&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.WriteLine(connectionPoint);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you re-run your application now, you’ll see that you’ve created a connection point which is listed in the feed we retrieved earlier. The last thing to do now is clean up after ourselves by issuing a delete against the resource we just created:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Connection Point management addresses are similar to &lt;a href="http://www.odata.org/developers/protocols/uri-conventions#AddressingEntries"&gt;OData&lt;/a&gt; addresses – we address the specific connection point to delete by appending the connection point management Uri with the name of the item to delete in parenthesis: 

    &lt;br /&gt;

    &lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;&amp;#160;&amp;#160;&amp;#160; var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt; connectionPointManagementAddress&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + ManagementHostName + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;/Resources/ConnectionPoints(&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + connectionPointName + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;)&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; 

    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;Add the ACS auth token to the header of a WebClient and issue a &lt;em&gt;Delete&lt;/em&gt; against the entry: 

    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;    using&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; client = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;())&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.Headers.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;HttpRequestHeader&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Authorization, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;WRAP access_token=\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; + authToken + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;\&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.UploadString(connectionPointManagementAddress, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;DELETE&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" size="2"&gt;.Empty);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, there we go: Listing, Creating and Deleting Connection Points. Download the full example from Skydrive:&lt;/p&gt;
&lt;center&gt;&lt;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="http://cid-f417b199bb8eca27.office.live.com/embedicon.aspx/.Public/Blog/ConnectionPoints.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/center&gt;

&lt;p&gt;___ &lt;/p&gt;

&lt;p&gt;&lt;sup&gt;1&lt;/sup&gt; You’ll need to have a WRAP token in the Http Authorization Header to access this resource, so you can’t just navigate to it in a browser.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;2&lt;/sup&gt; Read more about the Access Control Service at Justin Smith’s blog. Sample code to retrieve a token is included in the download at the end of this post.&lt;/p&gt;

&lt;p&gt;&lt;sup&gt;3&lt;/sup&gt; An example of using the Syndication primitives to manipulate connection points is available in the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=d89640fc-c552-446e-aead-b1e0d940f31b&amp;amp;displaylang=en"&gt;October 2010 Windows Azure AppFabric Sample&lt;/a&gt; ‘ManagementOperations’&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10084346" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/AppFabric/">AppFabric</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Service+Bus/">Service Bus</category></item><item><title>Windows Authentication, ADFS and the Access Control Service</title><link>http://blogs.msdn.com/b/willpe/archive/2010/10/25/windows-authentication-adfs-and-the-access-control-service.aspx</link><pubDate>Mon, 25 Oct 2010 18:56:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10080506</guid><dc:creator>willpe</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10080506</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10080506</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2010/10/25/windows-authentication-adfs-and-the-access-control-service.aspx#comments</comments><description>&lt;p&gt;Its just a few weeks ago that I started looking in more detail at the &lt;a href="http://portal.appfabriclabs.com/"&gt;Windows Azure AppFabric Access Control Service&lt;/a&gt; (or just ACS to its friends) and one of the first things I wanted to figure out was how to federate between my on-premise Active Directory domain and ACS. With a few pointers, its not too tricky, but I figured I’d walk you through the whole process anyhow!&lt;/p&gt;  &lt;p&gt;I’m going to assume that you’ve got an account set up with AppFabric Labs (&lt;a href="http://portal.appfabric.labs.com"&gt;http://portal.appfabric.labs.com&lt;/a&gt;) and an Active Directory domain installed too – if you don’t (or you want play about on a test domain) then just spin up a &lt;a href="http://www.microsoft.com/windowsserver2008/en/us/virtual-hard-drive.aspx"&gt;VM running Windows Server 2008 (or R2)&lt;/a&gt; and &lt;a href="http://technet.microsoft.com/en-us/library/cc755059(WS.10).aspx"&gt;Install Active Directory Domain Services&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Here’s what we’ll do:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download and Install &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=118c3588-9070-426a-b655-6cec0a92c10b&amp;amp;displaylang=en"&gt;Active Directory Federation Services&lt;/a&gt; (ADFS) v2.0 &lt;/li&gt;    &lt;li&gt;Configure a certificate to use with ADFS &lt;/li&gt;    &lt;li&gt;Setup ADFS and enable Endpoints for Windows Authentication &lt;/li&gt;    &lt;li&gt;Establish a Trust relationship from ADFS to ACS &lt;/li&gt;    &lt;li&gt;Provision a Service Namespace&amp;#160; X.509 Certificate in ACS &lt;/li&gt;    &lt;li&gt;Establish a Trust relationship from ACS to ADFS &lt;/li&gt;    &lt;li&gt;Create Rules to pass through claims from ADFS to the Relying Party Application via ACS &lt;/li&gt;    &lt;li&gt;Use the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=eb9c345f-e830-40b8-a5fe-ae7a864c4d76&amp;amp;displaylang=en"&gt;Windows Identity Foundation&lt;/a&gt; (WIF) to get a SAML token from ADFS &lt;/li&gt;    &lt;li&gt;Submit the SAML token to ACS to retrieve a set of claims as a SWT token &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Download and Install ADFS v2&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download the appropriate version of the ADFS v2 update from the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?familyId=118C3588-9070-426A-B655-6CEC0A92C10B&amp;amp;hash=quA8ErERAs1emw5OYr3veGAzKaOtoVMhZ2gbuOFkLsBIs3H1Cd29vIAxrZiPGu7Gba24wnHuNGXPzvxp8mcryg%3d%3d"&gt;Microsoft Download Center&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Install ADFS, you’ll probably want to Install a &lt;strong&gt;Federation Server.&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;When setup completes, launch the AD FS 2.0 management console. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Create a Self-Signed SSL Certificate&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Before you can configure ADFS you’ll need an SSL Certificate configured on your machine – if you have one already, skip ahead to the next step. Otherwise take you can setup a self-signed (untrusted) certificate using IIS. It goes without saying that you shouldn’t use a self-signed certificate in a production environment!&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Open the IIS Management Console &lt;/li&gt;    &lt;li&gt;In the Connections pane on the left hand side, select your server &lt;/li&gt;    &lt;li&gt;Double click on Server Certificates then select ‘Create Self-Signed Certificate’ from the actions pane on the right:      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/6685.image_5F00_714AC500.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; padding-left: 0px; padding-right: 0px; display: inline; float: ; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/8322.image_5F00_thumb_5F00_353E834B.png" width="639" height="227" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Type a name for the certificate – I’ve named mine ‘Self-Signed Certificate’ (creative, huh?) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Configure ADFS and Enable Windows Authentication Endpoints&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;From the &lt;strong&gt;AD FS 2.0 Management&lt;/strong&gt; console, start the &lt;strong&gt;Server Configuration Wizard&lt;/strong&gt;       &lt;ol&gt;       &lt;li&gt;Create a &lt;strong&gt;New Federation Service&lt;/strong&gt; on a &lt;strong&gt;Stand-alone federation server&lt;/strong&gt;. &lt;/li&gt;        &lt;li&gt;In the third step, choose your &lt;strong&gt;Self-Signed Certificate&lt;/strong&gt; – of course, if you already have a trusted, chained certificate for your server, you should use that instead! &lt;/li&gt;        &lt;li&gt;Click &lt;strong&gt;Finish&lt;/strong&gt; and ADFS will compete the configuration of your new Federation Server &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Next, we’ll enable some Endpoints to allow us to retrieve SAML tokens from ADFS using our Windows Credentials. We’ll do this over the WS-Trust 1.3 Protocol using Transport Security with a Message Credential.      &lt;ol&gt;       &lt;li&gt;Expand the &lt;strong&gt;Service&lt;/strong&gt; element of the navigation pane (left) and select &lt;strong&gt;Endpoints&lt;/strong&gt; &lt;/li&gt;        &lt;li&gt;Scroll down the list and select the &lt;strong&gt;/adfs/services/trust/13/windowsmixed&lt;/strong&gt; endpoint – right click and &lt;strong&gt;Enable&lt;/strong&gt; it.           &lt;br /&gt;          &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/6114.image_5F00_3AACF3EF.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/8836.image_5F00_thumb_5F00_1A25B43D.png" width="641" height="70" /&gt;&lt;/a&gt;           &lt;br /&gt;&lt;/li&gt;        &lt;li&gt;You’ll be alerted that you need to restart the AD FS 2.0 Service – open up the Services manager (services.msc) and restart the AD FS 2.0 Windows Service. You can read more about the various available &lt;a href="http://technet.microsoft.com/en-us/library/adfs2-help-endpoints(WS.10).aspx"&gt;ADFS endpoints on TechNet&lt;/a&gt;. &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;Establish a Trust relationship from ADFS to ACS&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;So, ADFS is now acting as an STS (Security Token Service) for your Active Directory domain, this means that you’re ready to setup federated authentication with other STSs or Identity Providers like the Windows Azure AppFabric Access Control Service (ACS). To do that, we need to establish a bidirectional trust relationship between ADFS and ACS – this allows your ACS project to process incoming tokens from your Active Directory and ensure that Active Directory trusts ACS and will issue tokens for use with it. We’ll be using AppFabric Labs for this – its free, so go &lt;a href="https://portal.appfabriclabs.com/Default.aspx?wa=wsignin1.0"&gt;Sign Up&lt;/a&gt; for an account if you don’t have one already.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Visit the &lt;a href="http://portal.appfabriclabs.com/"&gt;Windows Azure AppFabric Portal&lt;/a&gt;. Click on your project to bring up a list of your service namespaces, then choose ‘&lt;strong&gt;Access Control&lt;/strong&gt;’ from the service namespace you want to issue tokens for from ADFS:       &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/3058.image_5F00_1D579C25.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/5518.image_5F00_thumb_5F00_7C64297D.png" width="648" height="143" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;On the next page, click the big, orange ‘&lt;strong&gt;Manage&lt;/strong&gt;’ button to view the Access Control Service management UI. On the left, you’ll see a set of links directing you to common ACS Administrative tasks: &lt;/li&gt;    &lt;li&gt;To add a new Identity Provider to your ACS Service Namespace you (unsuprisingly) use the &lt;strong&gt;Identity Providers&lt;/strong&gt; link &lt;/li&gt;    &lt;li&gt;Choose ‘&lt;strong&gt;Add Identity Provider&lt;/strong&gt;’ &lt;/li&gt;    &lt;li&gt;Since we just spent a while setting up ADFS, you’ll want to Add a ‘&lt;strong&gt;Microsoft Active Directory Federation Services 2.0&lt;/strong&gt;’ Identity Provider &lt;/li&gt;    &lt;li&gt;Choose a sensible display name (or a wacky one if like, its really up to you) &lt;/li&gt;    &lt;li&gt;Upload some Federation Metadata.      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;If (like me) you’re using an ADFS installation which doesn’t have an Internet Facing IP Address (i.e., there’s no way to access your ADFS server from the public internet) then you’ll want to save a copy of your federation metadata as a UTF-8 Xml file and use the upload button. You can find the metadata at &lt;/em&gt;&lt;a href="https://[Your-ADFS-Server]/FederationMetadata/2007-06/FederationMetadata.xml"&gt;&lt;strong&gt;&lt;em&gt;https://[Your-ADFS-Server]/FederationMetadata/2007-06/FederationMetadata.xml&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Specify a login-link name (the Display Name is probably a good choice!) &lt;/li&gt;    &lt;li&gt;Click ‘&lt;strong&gt;Save&lt;/strong&gt;’ &lt;/li&gt;    &lt;li&gt;You’re returned to the list of Identity Providers, but now it contains your ADFS STS – simple, huh? &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Next, we need to perform a very similar process on your ADFS server, establishing a trust relationship back to ACS.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Establish a Trust relationship from ACS to ADFS&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;ADFS won’t issue tokens for use against the Access Control Service if it doesn’t trust it – we’ll need to configure a default signing certificate in ACS, generate some Federation Metadata and share that with our ADFS instance to finish off the establishment of this trust relationship.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Use the steps above to get to the &lt;strong&gt;Access Control Management&lt;/strong&gt; page for your service namespace. &lt;/li&gt;    &lt;li&gt;In the ‘&lt;strong&gt;Develop&lt;/strong&gt;’ area, click on ‘&lt;strong&gt;Application Integration&lt;/strong&gt;’ &lt;/li&gt;    &lt;li&gt;Towards the bottom of this page, you’ll see an Endpoint Reference for &lt;strong&gt;WS-Federation Metadata&lt;/strong&gt; – copy and paste the link into your address bar and hit enter. &lt;/li&gt;    &lt;li&gt;At this point, you’ll either see some Federation Metadata or – more likely – a wonderful error message, if you don’t see the error, skip ahead to Step 15:      &lt;br /&gt;      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/3542.image_5F00_5B70B6D6.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/2860.image_5F00_thumb_5F00_48BBBD1F.png" width="437" height="128" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;This happens because you don’t have a default certificate configured for signing – we’ll go upload one and then gain access to our precious metadata. &lt;/li&gt;    &lt;li&gt;Go back to the &lt;strong&gt;Access Control Management&lt;/strong&gt; page and click &lt;strong&gt;Certificates and Keys&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;You need to &lt;strong&gt;Add a Token Signing Certificate&lt;/strong&gt;, so click on the relevant link &lt;/li&gt;    &lt;li&gt;Ensure that X.509 is selected as the certificate type and enter a name. &lt;/li&gt;    &lt;li&gt;You’ll need to generate a certificate which you can do using the MakeCert tool which is part of the Windows SDK (if you have VS2010, you already have this installed, just start a Visual Studio Command Prompt and type ‘MakeCert’.      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;MakeCert.exe -r -pe -n &amp;quot;CN=&lt;strong&gt;&amp;lt;Your-Service-Namespace&amp;gt;&lt;/strong&gt;.accesscontrol.appfabriclabs.com&amp;quot; -sky exchange -ss my&lt;/em&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;In the same command prompt window, use CertUtil to find and then export the certificate you just created:      &lt;ol&gt;       &lt;li&gt;Run CertUtil to retrieve details of the certificate that was just created. Note down the &lt;strong&gt;SHA1 Cert Hash&lt;/strong&gt; (it’s a hex string like: b4 24 b5 c2 ef 40 5c 26 76 38 12 02 95 c1 56 5f 18 25 4f):           &lt;ul&gt;           &lt;li&gt;&lt;em&gt;CertUtil -user -store My &lt;strong&gt;&amp;lt;Your-Service-Namespace&amp;gt;&lt;/strong&gt;.accesscontrol.appfabriclabs.com&lt;/em&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;Run CertUtil again to export the private key. You need to specify a password, the SHA1 hash and a filename for the PFX that will be created:          &lt;ul&gt;           &lt;li&gt;&lt;em&gt;CertUtil -user –p &lt;strong&gt;&amp;lt;Some-Password&amp;gt;&lt;/strong&gt; –exportpfx “&lt;strong&gt;&amp;lt;Your-SHA1-Cert-Hash&amp;gt;&lt;/strong&gt;” &lt;strong&gt;&amp;lt;Output-Filename.pfx&amp;gt;&lt;/strong&gt;&lt;/em&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Back at the portal, upload the private key (.pfx) file you just creates and enter the password you specified to CertUtil &lt;/li&gt;    &lt;li&gt;In the &lt;strong&gt;Used For&lt;/strong&gt; field, specify &lt;strong&gt;Service Namespace&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt; &lt;/li&gt;    &lt;li&gt;Browse back to the metadata URL from step 4: this time, no error and lots of lovely metadata! &lt;/li&gt;    &lt;li&gt;If your ADFS server doesn’t have internet access, save this federation metadata to file and transfer it to the ADFS Server &lt;/li&gt;    &lt;li&gt;Login to your ADFS Server and Start the &lt;strong&gt;AD FS 2.0 Management Console&lt;/strong&gt;. &lt;/li&gt;    &lt;li&gt;In the Console Tree (Left), right click on ‘&lt;strong&gt;Relying Party Trusts&lt;/strong&gt;’ under the ‘Trust Relationships’ node and choose ‘&lt;strong&gt;Add Relying Party Trust&lt;/strong&gt;’. &lt;/li&gt;    &lt;li&gt;A wizard pops up, skip past the welcome page to ‘Select Data Source’ and either enter the URI of your federation metadata (something like: &lt;a href="https://&amp;lt;Your-Service-Namespace&amp;gt;.accesscontrol.appfabriclabs.com/FederationMetadata/2007-06/FederationMetadata.xml"&gt;.accesscontrol.appfabriclabs.com/FederationMetadata/2007-06/FederationMetadata.xml&amp;quot;&amp;gt;https://&amp;lt;Your-Service-Namespace&amp;gt;.accesscontrol.appfabriclabs.com/FederationMetadata/2007-06/FederationMetadata.xml&lt;/a&gt;)&amp;#160; or upload the xml document if you saved it in step 15. &lt;/li&gt;    &lt;li&gt;Specify a display name and choose your issuance rules policy – for simplicity’s sake I’m going to select ‘&lt;strong&gt;Permit All Users to Access this Relying Party&lt;/strong&gt;’ &lt;/li&gt;    &lt;li&gt;On the next page, confirm all the data you’ve entered and hit finish. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;When you’re done, leave the ‘Open the Edit Claim Rules dialog’ option checked – we’ll use this dialog to add some rules to this trust relationship allowing data to flow from Active Directory and into ACS. To get back to this dialog, right click on the Relying Party Trust for ACS and click &lt;strong&gt;‘Edit Claim Rules’&lt;/strong&gt;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;On the &lt;strong&gt;Issuance Transform Rules&lt;/strong&gt; tab, click &lt;strong&gt;Add Rule&lt;/strong&gt;. &lt;/li&gt;    &lt;li&gt;Select &lt;strong&gt;‘Pass Through or Filter an Incoming Claim’&lt;/strong&gt; as the template to use and click Next &lt;/li&gt;    &lt;li&gt;Now we’ll configure a claim (i.e. piece of identity data like role membership, username, etc.) to be passed through to ACS – just select the claim from the drop down list, specify a name and click Finish:      &lt;br /&gt;      &lt;br /&gt;&lt;a href="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/0815.image_5F00_60DF277A.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: ; 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://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-07-11-metablogapi/2134.image_5F00_thumb_5F00_74F84403.png" width="520" height="277" /&gt;&lt;/a&gt;       &lt;br /&gt;&lt;/li&gt;    &lt;li&gt;Repeat steps 1-thru-3 to add additional claims to pass thru to ACS (if you feel like it!) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;At this point, some congratulations are in order: you’ve installed and configured ADFS, you’ve created and uploaded a certificate to allow signing of your ACS Federation Metadata, you’ve established a bi-directional trust relationship between ADFS and ACS and you’ve specified some claims which can be passed through to the Access Control Service. There’s just a little more work ahead of you before you can perform that first piece of federated, claims-based authentication.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Head back over to the Windows Azure AppFabric portal and get yourself back to the Access Control Service Management page we’ve been using in the past couple of sections. This time, click the ‘&lt;strong&gt;Rule Groups&lt;/strong&gt;’ link. &lt;/li&gt;    &lt;li&gt;Select the rule group you want to modify.      &lt;ul&gt;       &lt;li&gt;&lt;em&gt;Rule Groups define how claims from one party are transformed by the Access Control Service before being passed on to another (for example, only passing through the ‘First name’ claim from Facebook or ADFS to a service located at a specific Url). You associate Rule Groups with Realms (that is, the URI of a resource which is secured by the Access Control Service) on the Replying Party Application page. By default, there’s just one Rule Group and just one Relying Party Application. Feel free to add more!&lt;/em&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Add a rule to the rule group with the ‘&lt;strong&gt;Add Rule&lt;/strong&gt;’ link- we’re going to configure the windows account name to pass through, but you can repeat this process to forward or transform as many claims as you want/need (full name, email address, etc.). &lt;/li&gt;    &lt;li&gt;Specify the incoming claim details in the ‘&lt;strong&gt;If…&lt;/strong&gt;’ section. In the &lt;strong&gt;Claims Issuer&lt;/strong&gt; area, choose your new ADFS Identity Provider, next choose the &lt;strong&gt;Input claim type&lt;/strong&gt; that you want to pass through. I’m going to pass through the Windows Account Name which has the type &lt;em&gt;‘&lt;/em&gt;&lt;a title="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname" href="http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname"&gt;&lt;em&gt;http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname&lt;/em&gt;&lt;/a&gt;&lt;em&gt;’&lt;/em&gt;. I’m going to accept any input claim value. &lt;/li&gt;    &lt;li&gt;Since we’re just going to pass through this claim (the Windows Account Name), select ‘&lt;strong&gt;Pass through&lt;/strong&gt;’ in both the Output Claim Type and Output Claim Value sections. You could (of course) perform more complex rule processing here if you chose to. &lt;/li&gt;    &lt;li&gt;Click the &lt;strong&gt;Save&lt;/strong&gt; Button &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;We’re almost done. Now that we’ve established a claims processing rule (pass through the Windows Account Name) associated with our newly trusted identity provider (your Active Directory Federation Server) we can fire up Visual Studio and write some code. In this next section, we’ll get a SAML Token from ADFS and exchange it for a SWT token via the access control service. Once you’ve got the Simple Web Token (SWT) the Authentication World becomes Your Oyster – go and use it to auth against web services/sites or anything else!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Use the &lt;/strong&gt;&lt;strong&gt;Windows Identity Foundation&lt;/strong&gt;&lt;strong&gt; to get a SAML token from ADFS &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;There are a couple of things we need to do to get a token from ADFS. Firstly, we’ll need to validate that Self-Signed Certificate we created a while ago for securing SSL traffic to and from the ADFS server, secondly we’ll use the Windows Identity Foundation to request the token from an ADFS endpoint.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Download and Install the &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=EB9C345F-E830-40B8-A5FE-AE7A864C4D76"&gt;Windows Identity Foundation&lt;/a&gt; (WIF) and &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c148b2df-c7af-46bb-9162-2c9422208504"&gt;Windows Identity Foundation SDK&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Create a new .Net Framework 4.0 Console Application in Visual Studio 2010 &lt;/li&gt;    &lt;li&gt;Add References to the &lt;strong&gt;Microsoft.IdentityModel&lt;/strong&gt;, &lt;strong&gt;System.IdentityModel&lt;/strong&gt; and &lt;strong&gt;System.ServiceModel&lt;/strong&gt; assemblies. &lt;/li&gt;    &lt;li&gt;Add a method, , to validate the SSL Certificate from ADFS (since the certificate we’re using isn’t chained to a root certification authority we’ll need to explicitly say that its OK to trust). Use the code below, but be sure to replace my ADFS server name (vm-willpe-adfs.willpe.sb) with the fully qualified DNS domain name of your ADFS Server:      &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; RemoteCertificateValidationCallback(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;X509Certificate&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; certificate, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;X509Chain&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; chain, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SslPolicyErrors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; sslPolicyErrors)&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sslPolicyErrors == &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SslPolicyErrors&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.None&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; || &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Equals(certificate.Issuer, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;CN=vm-willpe-adfs.willpe.sb&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;StringComparison&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" size="1"&gt;.InvariantCultureIgnoreCase);&lt;br /&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Next, we'll override the default Certificate Validation Callback - add this line to the Main method of Program.cs 
    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font size="1"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;&lt;font style="font-size: "&gt;ServicePointManager&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: " color="#000000"&gt;.ServerCertificateValidationCallback += RemoteCertificateValidationCallback;&lt;/font&gt;&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Now we need to make some calls into the Windows Identify Foundation to request a SAML token from ADFS. There are a couple of things to note here. First up, when we enabled endpoints in ADFS, we selected a WS-Trust 1.3 Endpoint with Windows Authentication and Mixed Mode security. This means that we need to use version 1.3 of WS-Trust, specify Windows Credentials and use Transport Security with a Message Credential when connecting. We’ll also have to use the full URL to the endpoint we enabled in ADFS. Here’s the code to create a WS-Trust Channel factory compatible with this endpoint. As usual, don’t forget to change my ADFS hostname (vm-willpe-adfs) to yours: 
    &lt;br /&gt;

    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;br /&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font style="font-size: "&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; stsUrl = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://vm-willpe-adfs/adfs/services/trust/13/windowsmixed&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; trustChannelFactory =&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WindowsWSTrustBinding&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SecurityMode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.TransportWithMessageCredential),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;(stsUrl)));&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;trustChannelFactory.TrustVersion = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;TrustVersion&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.WSTrust13;&lt;br /&gt; &lt;br /&gt;trustChannelFactory.Credentials.Windows.ClientCredential.Domain = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;lt;&amp;lt;Your NetBios Domain Name Here &amp;gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;trustChannelFactory.Credentials.Windows.ClientCredential.UserName = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;@&amp;quot;&amp;lt;&amp;lt;Your Domain Username Here&amp;gt;&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;trustChannelFactory.Credentials.Windows.ClientCredential.Password = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;@&amp;quot;&amp;lt;&amp;lt;Your Domain Password Here&amp;gt;&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;With a trust channel factory instantiated and configured, you can use a RequestSecurityToken to make the token request. Note that you’ll need to specify the Url that the token applies to – this is going to be your ACS Management Url: 
    &lt;br /&gt;

    &lt;br /&gt;

    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: " size="1"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; acsUrl = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://willpe-blog.accesscontrol.appfabriclabs.com/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" size="1"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af" face="Consolas"&gt;&lt;font style="font-size: " size="1"&gt;RequestSecurityToken&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; rst =&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RequestSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RequestTypes&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Issue, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;KeyTypes&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.Bearer);&lt;br /&gt;rst.AppliesTo = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;(acsUrl);&lt;br /&gt;rst.TokenType = Microsoft.IdentityModel.Tokens.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SecurityTokenTypes&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.Saml2TokenProfile11;&lt;br /&gt; &lt;/font&gt;&lt;br /&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannel&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; channel = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannel&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)trustChannelFactory.CreateChannel();&lt;/font&gt;&lt;br /&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;GenericXmlSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; token = channel.Issue(rst) &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;GenericXmlSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;/font&gt;&lt;br /&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; tokenString = token.TokenXml.OuterXml;&lt;/font&gt;&lt;br /&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; tokenString;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Putting it all together, you’ll want to add the method ‘GetSamlToken’ to Program.cs:&amp;#160; &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; GetSamlToken(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; domain, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; userName, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; password)&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; acsUrl = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://willpe-blog.accesscontrol.appfabriclabs.com/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; stsUrl = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://vm-willpe-adfs/adfs/services/trust/13/windowsmixed&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; trustChannelFactory =&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannelFactory&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WindowsWSTrustBinding&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SecurityMode&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.TransportWithMessageCredential),&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;(stsUrl)));&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; trustChannelFactory.TrustVersion = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;TrustVersion&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.WSTrust13;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; trustChannelFactory.Credentials.Windows.ClientCredential.Domain = domain;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; trustChannelFactory.Credentials.Windows.ClientCredential.UserName = userName;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; trustChannelFactory.Credentials.Windows.ClientCredential.Password = password;&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;try&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RequestSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; rst =&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RequestSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RequestTypes&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Issue, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrust13Constants&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;KeyTypes&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.Bearer);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; rst.AppliesTo = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EndpointAddress&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;(acsUrl);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; rst.TokenType = Microsoft.IdentityModel.Tokens.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SecurityTokenTypes&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.Saml2TokenProfile11;&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannel&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; channel = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WSTrustChannel&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;)trustChannelFactory.CreateChannel();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;GenericXmlSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; token = channel.Issue(rst) &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;GenericXmlSecurityToken&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; tokenString = token.TokenXml.OuterXml;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; tokenString;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;finally&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#000000" size="1"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; trustChannelFactory.Close();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Add a line to the Main method to call GetSamlToken and verify that you get a nice, chunky XML token back from ADFS. With just a couple more lines of code, all of that markup will become a Simple Web Token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit the SAML token to ACS to retrieve a set of claims as a SWT token &lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The hard work is over now – all we need to do is submit the SAML token we retrieved to ACS and get a Simple Web Token in response. With that token, you’re good to authenticate against any (properly configured) resource secured by the AppFabric Access Control Service.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Add the method GetSimpleWebToken(string samlToken) to Program.cs &lt;/li&gt;

  &lt;li&gt;Retrieve your ACS STS Uri from the portal, it’s probably something like: &lt;a href="https://[Your-Service-Namespace].accesscontrol.appfabriclabs.com/WRAPv0.9/"&gt;https://[Your-Service-Namespace].accesscontrol.appfabriclabs.com/WRAPv0.9/&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Upload the SAML Token to ACS. You need to specify the Scope (that is, the ‘Applies To’/’Expected Audience’ Url or the address of the resource which this token is to be used against), the assertion format (SAML in this case) and the assertion itself. I’m using this token to authenticate directly against the ACS management service, so my parameters look like this: 
    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;&lt;font style="font-size: "&gt;NameValueCollection&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt; parameters = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;NameValueCollection&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;();&lt;br /&gt;parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_scope&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://willpe-blog.accesscontrol.appfabriclabs.com/mgmt&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;);&lt;br /&gt;parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_assertion_format&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;SAML&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;);&lt;br /&gt;parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_assertion&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, samlToken);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;

  &lt;li&gt;Then we’ll simply upload these values to the Access Control Service and extract the SWT token from the response. Putting it all together, the GetSimpleWebToken method looks like this: 
    &lt;pre style="line-height: normal; list-style-type: disc; font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: "&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: "&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; GetSwtToken(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: "&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; samlToken)&lt;br /&gt;{&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; appliesTo = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://willpe-blog.accesscontrol.appfabriclabs.com/mgmt&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; acsStsUrl = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;https://willpe.accesscontrol.appfabriclabs.com/WRAPv0.9/&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;;&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;try&lt;/font&gt;&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; client = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebClient&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; client.BaseAddress = acsStsUrl;&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;NameValueCollection&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; parameters = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;NameValueCollection&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_scope&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;, appliesTo);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_assertion_format&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;SAML&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; parameters.Add(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_assertion&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;, samlToken);&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;[] responseBytes = client.UploadValues(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;, parameters);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; response = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Encoding&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.UTF8.GetString(responseBytes);&lt;br /&gt; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Uri&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.UnescapeDataString(response&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .Split(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;'&amp;amp;'&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .Single(value =&amp;gt; value.StartsWith(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;&amp;quot;wrap_access_token=&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;StringComparison&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;.OrdinalIgnoreCase))&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; .Split(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;'='&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;)[1]);&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;catch&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WebException&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt; wex)&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; value = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;#160;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;StreamReader&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: "&gt;&lt;font size="1"&gt;&lt;font color="#000000"&gt;(wex.Response.GetResponseStream()).ReadToEnd();&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;throw&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000" size="1"&gt;;&lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;br /&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So, there we go – we’ve installed and configured ADFS, Created a Trust Relationship between the AppFabric Access Control Service and your new ADFS Instance, we configured ACS to accept incoming claims from the Active Directory Identity Provider and pass-through the Windows Account name. Then we used WIF to get swap our Windows Credentials for a SAML token which we sent to ACS to get a Simple Web Token. The result? A little string like this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname=&lt;b&gt;WILLPE\Test&lt;/b&gt; 

    &lt;br /&gt;&amp;amp;http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider=&lt;b&gt;http://VM-WILLPE-ADFS.willpe.sb/adfs/services/trust&lt;/b&gt; 

    &lt;br /&gt;&amp;amp;Audience=&lt;b&gt;https://willpe-blog.accesscontrol.appfabriclabs.com/mgmt&lt;/b&gt; 

    &lt;br /&gt;&amp;amp;ExpiresOn=&lt;b&gt;1288060895&lt;/b&gt; 

    &lt;br /&gt;&amp;amp;Issuer=&lt;b&gt;https://willpe-blog.accesscontrol.appfabriclabs.com/&lt;/b&gt; 

    &lt;br /&gt;&amp;amp;HMACSHA256=[Base64-Hash-Code]&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can download the full sample from SkyDrive – feel free to leave any comments/questions below or find me on Twitter (&lt;a href="http://twitter.com/willpe"&gt;@willpe&lt;/a&gt;)&lt;/p&gt;
&lt;center&gt;&lt;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="http://cid-f417b199bb8eca27.office.live.com/embedicon.aspx/.Public/Blog/AcsFederationSample.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/center&gt;

&lt;p&gt;I hope this helps,&lt;/p&gt;

&lt;p&gt;Will&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10080506" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/AppFabric/">AppFabric</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/ACS/">ACS</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/WIF/">WIF</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Identity/">Identity</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/ADFS/">ADFS</category></item><item><title>How to figure out when your ACS Auth Token Expires</title><link>http://blogs.msdn.com/b/willpe/archive/2010/10/12/how-to-figure-out-when-your-acs-auth-token-expires.aspx</link><pubDate>Tue, 12 Oct 2010 17:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10074850</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=10074850</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=10074850</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2010/10/12/how-to-figure-out-when-your-acs-auth-token-expires.aspx#comments</comments><description>&lt;p&gt;If you&amp;rsquo;re using the &lt;a href="http://portal.appfabriclabs.com"&gt;Windows Azure AppFabric Access Control Service&lt;/a&gt; (ACS) you&amp;rsquo;ve probably encountered a Simple Web Token (SWT) accessed via the Web Resource Authorization Protocol (WRAP). Doing this recently, I wanted to figure out when my token expired (so that I could cache it until a couple of minutes before expiry, improving my app's performance) &amp;ndash; you might find this snippet useful if you want to figure out when a SWT token expires:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: ; font-size: ; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;             &lt;br /&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt; Gets the UTC time that the specified token expires.&lt;/span&gt;&lt;/span&gt;             &lt;br /&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/span&gt;             &lt;br /&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;param name="token"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;An Access Token from the Access Control Service .&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/span&gt;             &lt;br /&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;///&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;returns&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #008000;"&gt;The time that the token expires as a UTC DateTime.&lt;/span&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #808080;"&gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;/span&gt;             &lt;br /&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;public&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;static&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; GetExpiryTime(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="color: #000000; font-size: x-small;"&gt; token)            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {             &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;&lt;span&gt;var&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: #000000;"&gt; swt = token.Substring(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;"wrap_access_token=\""&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Length, token.Length - (&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;"wrap_access_token=\""&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;.Length + 1));            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; tokenValue = &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;.UnescapeDataString(swt);            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; properties = (&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;from&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; prop &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;in&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; tokenValue.Split(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;'&amp;amp;'&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;)            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;let&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; pair = prop.Split(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] { &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;'='&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt; }, 2)            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;select&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt; { Name = pair[0], Value = pair[1] })            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .ToDictionary(p =&amp;gt; p.Name, p =&amp;gt; p.Value);             &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; expiresOnUnixTicks = &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;int&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Parse(properties[&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;"ExpiresOn"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;]);            &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;var&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; epochStart = &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;(1970, 01, 01, 0, 0, 0, 0, &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;DateTimeKind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;.Utc);            &lt;br /&gt;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;return&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; epochStart.AddSeconds(expiresOnUnixTicks);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-family: ; font-size: ; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span&gt;&lt;span style="color: #000000; font-size: x-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-family: ; font-size: ; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;span style="font-family: Consolas; color: #000000; font-size: x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;The code takes an access token from ACS (of the format &lt;em&gt;wrap_access_token=&amp;rdquo;[Insert-SWT-Here]&amp;rdquo;&lt;/em&gt;) and extracts the &amp;lsquo;ExpiresOn&amp;rsquo; value from the SWT. According to the &lt;a href="http://lists.w3.org/Archives/Public/public-xg-socialweb/2010Feb/att-0055/draft-hardt-oauth-wrap-01.html#anchor56"&gt;OAuth WRAP Spec&lt;/a&gt;, this is a Unix time (i.e., the number of seconds past January 1, 1970 at 12am) expressed as a UTC time. So, don&amp;rsquo;t forget that if you want to figure out when the token expires in your &lt;strong&gt;local&lt;/strong&gt; time zone, you&amp;rsquo;ll need to convert it using the TimeZone type:&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-family: Consolas; color: #000000; font-size: x-small;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-size: x-small;"&gt;&lt;span style="color: #000000;"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.WriteLine(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #a31515;"&gt;"Your auth token expires at {0}."&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #2b91af;"&gt;TimeZone&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.CurrentTimeZone.ToLocalTime(&lt;/span&gt;&lt;span style="color: "&gt;&lt;span style="color: #0000ff;"&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;.AuthTokenExpiry));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;     &lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;I hope this helps,&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="line-height: normal; list-style-type: disc; margin: 0in 0in 0pt; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"&gt;Will&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10074850" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Security/">Security</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/AppFabric/">AppFabric</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/ACS/">ACS</category></item><item><title>The Fibonnaci Sequence using C# Iterators</title><link>http://blogs.msdn.com/b/willpe/archive/2010/04/07/the-fibonnaci-sequence-using-c-iterators.aspx</link><pubDate>Wed, 07 Apr 2010 20:05:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9991971</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=9991971</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=9991971</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2010/04/07/the-fibonnaci-sequence-using-c-iterators.aspx#comments</comments><description>&lt;style&gt;




.code {color: #000; font-family: consolas, 'Courier New', courier, monospace; font-size: 10pt}&lt;/style&gt;  &lt;p&gt;Iterators in C# are probably one of the least understood and most wonderful features the language has. They were added in C# 2.0 and are the magic that gives LINQ its &lt;a href="http://blogs.msdn.com/charlie/archive/2007/12/09/deferred-execution.aspx"&gt;Deferred Execution&lt;/a&gt; goodness. Anyway, I was needing an arbitrary length list of Guids today (although, with the &lt;a href="http://weblogs.asp.net/leftslipper/archive/2010/04/01/last-guid-used-up-new-scottguid-unique-id-to-replace-it.aspx"&gt;recent shortage&lt;/a&gt;, perhaps ScottGuIDs would have been a better choice) and used this cute little few-liner to get what I wanted:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;/p&gt;    &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9f44c71e-6b72-4e7d-a6ef-11aa706967aa" class="wlWriterEditableSmartContent"&gt; &lt;div class="code"&gt; &lt;div style="background-color: #ffffff; overflow: auto; padding: 2px 5px;"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Guid&lt;/span&gt;&amp;gt; Guids&lt;br&gt; {&lt;br&gt;     &lt;span style="color:#0000ff"&gt;get&lt;/span&gt;&lt;br&gt;     {&lt;br&gt;         &lt;span style="color:#0000ff"&gt;while&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;true&lt;/span&gt;)&lt;br&gt;         {&lt;br&gt;             &lt;span style="color:#0000ff"&gt;yield&lt;/span&gt; &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Guid&lt;/span&gt;.NewGuid();&lt;br&gt;         }&lt;br&gt;     }&lt;br&gt; }&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;    &lt;p&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;From there you can easily get yourself a list of, say, 5 Guids using LINQ’s &lt;a href="http://msdn.microsoft.com/en-us/library/bb300906.aspx"&gt;Take Extension&lt;/a&gt; Method:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b65d3f3f-aadb-4090-bb7c-88323090c94d" class="wlWriterEditableSmartContent"&gt; &lt;div class="code"&gt; &lt;div style="background-color: #ffffff; overflow: auto; padding: 2px 5px;"&gt;&lt;span style="color:#0000ff"&gt;var&lt;/span&gt; myGuids = &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.Guids.Take(5);&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Obviously, this made me want to generate some more interesting sequences, like Fibonnaci’s:   &lt;blockquote&gt;&lt;/blockquote&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:d65cdba0-ce38-4a99-8e1f-d312a0acd3bf" class="wlWriterEditableSmartContent"&gt; &lt;div class="code"&gt; &lt;div style="background-color: #ffffff; overflow: auto; padding: 2px 5px;"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt; Fibonnaci&lt;br&gt; {&lt;br&gt;     &lt;span style="color:#0000ff"&gt;get&lt;/span&gt;&lt;br&gt;     {&lt;br&gt;         &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; first = 0;&lt;br&gt;         &lt;span style="color:#0000ff"&gt;yield&lt;/span&gt; &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; first;&lt;br&gt; &lt;br&gt;         &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; second = 1;&lt;br&gt;         &lt;span style="color:#0000ff"&gt;yield&lt;/span&gt; &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; second;&lt;br&gt; &lt;br&gt;         &lt;span style="color:#0000ff"&gt;while&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;true&lt;/span&gt;)&lt;br&gt;         {&lt;br&gt;             &lt;span style="color:#0000ff"&gt;int&lt;/span&gt; next = first + second;&lt;br&gt;             first = second;&lt;br&gt;             second = next;&lt;br&gt; &lt;br&gt;             &lt;span style="color:#0000ff"&gt;yield&lt;/span&gt; &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; next;&lt;br&gt;         }&lt;br&gt;     }&lt;br&gt; }&lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Pretty terse, right?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9991971" width="1" height="1"&gt;</description></item><item><title>European Tech Talk Tour</title><link>http://blogs.msdn.com/b/willpe/archive/2008/11/21/european-tech-talk-tour.aspx</link><pubDate>Fri, 21 Nov 2008 15:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9131753</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=9131753</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=9131753</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2008/11/21/european-tech-talk-tour.aspx#comments</comments><description>&lt;P&gt;For a few days this autumn (or is it Winter now?) I’ll be out and about talking to great uni students about Microsoft Codename ‘M’, and some of the fantastic technical opportunities for graduates at Microsoft. Here are some resources:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Apply for a Position at Microsoft&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A target=_blank href="http://www.microsoft.com/college/ft_swandhwdev.mspx#pm" mce_href="http://www.microsoft.com/college/ft_swandhwdev.mspx#pm"&gt;Description of the Program Manager Role&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://www.microsoft.com/college/ft_swandhwdev.mspx#sde" mce_href="http://www.microsoft.com/college/ft_swandhwdev.mspx#sde"&gt;Description of the Software Development Engineer Role&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://www.microsoft.com/college/ft_swandhwdev.mspx#sdet" mce_href="http://www.microsoft.com/college/ft_swandhwdev.mspx#sdet"&gt;Description of the Software Development Engineer in Test Role&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://mdcc.dk/" mce_href="http://mdcc.dk"&gt;Learn about Microsoft Development Center Copenhagen (MDCC)&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you’d like to apply then use one of then send your CV/Resumé to us. Don’t forget to tell as about the things that really make you stand apart from your peers like your best university and individual projects or jobs!&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Full Time: &lt;/STRONG&gt;&lt;A href="mailto:MSGradCV@microsoft.com" mce_href="mailto:MSGradCV@microsoft.com"&gt;MSGradCV@microsoft.com&lt;/A&gt; &lt;BR&gt;&lt;STRONG&gt;Intern: &lt;/STRONG&gt;&lt;A href="mailto:InternCV@microsoft.com" mce_href="mailto:InternCV@microsoft.com"&gt;InternCV@microsoft.com&lt;/A&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Codename ‘M’ Resources&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;Video: &lt;A target=_blank href="http://channel9.msdn.com/pdc2008/TL23/" mce_href="http://channel9.msdn.com/pdc2008/TL23/"&gt;A Lap Around Oslo&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Video: &lt;A target=_blank href="http://channel9.msdn.com/pdc2008/TL27/" mce_href="http://channel9.msdn.com/pdc2008/TL27/"&gt;Oslo: The Language&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Video: &lt;A target=_blank href="http://channel9.msdn.com/pdc2008/TL31/" mce_href="http://channel9.msdn.com/pdc2008/TL31/"&gt;Textual DSLs&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Video: &lt;A target=_blank href="http://channel9.msdn.com/pdc2008/TL28/" mce_href="http://channel9.msdn.com/pdc2008/TL28/"&gt;Repository and Models&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A target=_blank href="http://msdn.microsoft.com/oslo" mce_href="http://msdn.microsoft.com/oslo"&gt;‘Oslo’ Developer Center&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://connect.microsoft.com/oslo" mce_href="http://connect.microsoft.com/oslo"&gt;‘Oslo’ Feedback and Bugs (Microsoft Connect)&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://code.msdn.microsoft.com/oslo/Release/ProjectReleases.aspx?ReleaseId=1707" mce_href="http://code.msdn.microsoft.com/oslo/Release/ProjectReleases.aspx?ReleaseId=1707"&gt;Download: ‘Oslo’ SDK&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A target=_blank href="http://martinfowler.com/bliki/Oslo.html" mce_href="http://martinfowler.com/bliki/Oslo.html"&gt;Martin Fowler’s Take on ‘M’&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When using these resources, please remember that this is a &lt;STRONG&gt;really&lt;/STRONG&gt; early preview. That means its all likely to change, its not ready for production and there are likely plenty of bugs! To help shape the future of modeling on our platform, &lt;EM&gt;please&lt;/EM&gt; send your feedback using Connect!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Replay the London Event&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I’ll be uploading the meeting recording from the London student partners event soon – please check back!&lt;/P&gt;
&lt;P&gt;For now, you can grab the slide deck from skydrive.&lt;/P&gt;
&lt;CENTER&gt;&lt;IFRAME style="BORDER-BOTTOM: #dde5e9 1px solid; BORDER-LEFT: #dde5e9 1px solid; PADDING-BOTTOM: 0px; BACKGROUND-COLOR: #ffffff; MARGIN: 3px; PADDING-LEFT: 0px; WIDTH: 240px; PADDING-RIGHT: 0px; HEIGHT: 66px; BORDER-TOP: #dde5e9 1px solid; BORDER-RIGHT: #dde5e9 1px solid; PADDING-TOP: 0px" marginHeight=0 src="http://cid-7041d30b1cc4ad99.skydrive.live.com/embedrowdetail.aspx/Public/SlideDecks/Europe%20MTC%20FY09.pptx" frameBorder=0 marginWidth=0 scrolling=no&gt;&lt;/IFRAME&gt;&lt;/CENTER&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you’ve got any questions or comments, just post a comment, and I’ll get back to you asap!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9131753" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/b/willpe/archive/tags/_2700_Oslo_2700_/">'Oslo'</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Codename+_2700_M_2700_/">Codename 'M'</category><category domain="http://blogs.msdn.com/b/willpe/archive/tags/Recruiting/">Recruiting</category></item><item><title>A selection of things which rocked my world this week</title><link>http://blogs.msdn.com/b/willpe/archive/2008/07/26/a-selection-of-things-which-rocked-my-world-this-week.aspx</link><pubDate>Sat, 26 Jul 2008 20:46:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8776198</guid><dc:creator>willpe</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/rsscomments.aspx?WeblogPostID=8776198</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.msdn.com/b/willpe/commentapi.aspx?WeblogPostID=8776198</wfw:comment><comments>http://blogs.msdn.com/b/willpe/archive/2008/07/26/a-selection-of-things-which-rocked-my-world-this-week.aspx#comments</comments><description>&lt;p&gt;Its been a fun and exciting week. Not only has Copenhagen managed to give us sunshine for days at a time, but I received my new tablet pc and home server too!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Tablet PCs are the coolest thing. Ever.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;To help me to be a better ‘mobile worker’ (i.e. work on the train to work as well as at home and in the office) I’m given a laptop at work, since I already have a slew of big, chunky performance laptops under my belt, I thought I’d opt for something a little more exciting, like the &lt;a href="http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/321957-321957-64295-321838-306995-3355644.html?jumpid=reg_R1002_USEN"&gt;HP 2710p Ultralight Notebook&lt;/a&gt;. Its light, gives a totally reasonable 4 hours of battery life under (what I consider) normal load and best of all, has that cool swiveling tablet functionality.&lt;/p&gt; &lt;p&gt;In case you’re not familiar with Tablet PCs, the screen rotates thru 180 degrees allowing you to close the laptop with the screen facing outwards, then use the stylus to write on it like a real, physical notebook. The most shocking thing is that it actually works! Its really easy to take notes on, the touch screen is responsive and crystal clear, coupled with OneNote and I haven’t used a piece of paper since the thing landed in my lap.&lt;/p&gt; &lt;p&gt;Windows Vista has some awesome built in tablet functionality, mainly the writing space overlay you are given to hand-write into any text box – the recognition is astounding, even my worst scrawled, scripted handwriting is correctly converted into typed characters. I’m experiencing an accuracy of about 95%, and its getting better every day, since windows is automatically adjusting to my style. Its weird, but I’ve really gotten used to having this new way to interact with my machine – from crossing out dodgy parts in Word document with a red felt tip, to circling mistakes in an excel graph and signing and mailing documents electronically, rather than the old Print-Sign-Fax farce of yesteryear.&lt;/p&gt; &lt;p&gt;The only mystery is why these things never took off… any ideas?&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Home Server&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;My old server didn’t quite make the trip to Copenhagen; I shouldn’t be surprised that it finally gave up living since in one form or another the poor thing has been alive (and abused) for close to 7 years now. Anywho, the upside of its sad demise is that the insurance company paid out for the cost of a similar replacement, and the payout stretched easily to buying myself a shiney new &lt;a href="http://www.shopping.hp.com/product/notebook/notebook_hp/home_servers/1/accessories/GG795AA%2523ABA;HHOJSID=rK3LLLgZjTSVvXcqSY1pdxHQSy291BJgnJS8NPDqPLdWGncf6pDw!1728617182"&gt;HP MediaSmart Server&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;As you might expect, its cool. It looks great, makes pretty much no noise (although there is a fan, which you can just about hear when is deathly quiet, a situation which rarely occurs in my house) and works way better than I expected. Just stick the install CD into a machine, whack the next button until it isn’t there anymore and you’re done – its working, on the network, named sensibly and ready for your files/backups/photos/music/whatever. Of course, there was the small matter of installing &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=1A6AEF46-DB57-401F-814F-6EFA26E7A1E8&amp;amp;displaylang=en"&gt;Power Pack 1&lt;/a&gt;, but the download was tiny and the install was painless.&lt;/p&gt; &lt;p&gt;Its my first look at the Home Server OS – which looks like it’s been derived from Server 2003 – and it seems like a pretty sweet platform. Being able to remote desktop into it is a great feature, and taking the ‘You can break your server by doing this’ warnings with a pinch of salt it seems like its really versatile! I’ll need to get it working with my VOIP phones sometime this week by seeing how much it likes Axon – we’ll see how that goes, but for now, its two thumbs up.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8776198" width="1" height="1"&gt;</description></item></channel></rss>
