<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rob Tiffany &#187; ADO.NET</title>
	<atom:link href="http://robtiffany.com/tag/ado-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://robtiffany.com</link>
	<description>Author, Mobility Strategist at Microsoft, Speaker, Advisor, Technology Executive, Former Navy Submariner</description>
	<lastBuildDate>Wed, 16 May 2012 01:19:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Consumerization of IT Collides with MEAP: Windows &gt; Cloud</title>
		<link>http://robtiffany.com/consumerization-of-it-collides-with-meap-windows-cloud/</link>
		<comments>http://robtiffany.com/consumerization-of-it-collides-with-meap-windows-cloud/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 04:51:39 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[MEAP]]></category>
		<category><![CDATA[ACS]]></category>
		<category><![CDATA[ADFS]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[AppFabric]]></category>
		<category><![CDATA[Auth]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure AppFabric]]></category>
		<category><![CDATA[CIO]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[CoIT]]></category>
		<category><![CDATA[Consumerization]]></category>
		<category><![CDATA[Consumerization of IT]]></category>
		<category><![CDATA[Critical Capabilities]]></category>
		<category><![CDATA[CTO]]></category>
		<category><![CDATA[Device Management]]></category>
		<category><![CDATA[EAI]]></category>
		<category><![CDATA[ERP]]></category>
		<category><![CDATA[Gartner]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[IE9]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Integrated Development Environment]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[IT Director]]></category>
		<category><![CDATA[Management]]></category>
		<category><![CDATA[MDM]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mobile Enterprise Application Platform]]></category>
		<category><![CDATA[OData]]></category>
		<category><![CDATA[On-Premises]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[SCCM]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[SQL Azure Data Sync]]></category>
		<category><![CDATA[Sync]]></category>
		<category><![CDATA[Sync Framework]]></category>
		<category><![CDATA[Web Role]]></category>
		<category><![CDATA[Web Services]]></category>
		<category><![CDATA[Web Storage]]></category>
		<category><![CDATA[WIF]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Intune]]></category>
		<category><![CDATA[Worker Role]]></category>

		<guid isPermaLink="false">http://robtiffany.com/meap/consumerization-of-it-collides-with-meap-windows-cloud</guid>
		<description><![CDATA[In my Consumerization of IT Collides with MEAP article last week, I described how to connect a Windows 7 device to Microsoft’s On-Premises servers.&#160; Whether you’re talking about a Windows 7 tablet or laptop, I showed that you can follow &#8230; <a href="http://robtiffany.com/consumerization-of-it-collides-with-meap-windows-cloud/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my Consumerization of IT Collides with MEAP article last week, I described how to connect a Windows 7 device to Microsoft’s On-Premises servers.&#160; Whether you’re talking about a Windows 7 tablet or laptop, I showed that you can follow the Garter MEAP Critical Capabilities to integrate with our stack in a consistent manner.&#160; Remember, the ability to support multiple mobile apps across multiple mobile platforms, using the same software stack is a key tenant to MEAP.&#160; It’s all about avoiding point solutions.</p>
<p>If you need a refresher on the Gartner MEAP Critical Capabilities, check out: <a title="http://robtiffany.com/meap/consumerization-of-it-collides-with-meap-windows-on-premises" href="http://robtiffany.com/meap/consumerization-of-it-collides-with-meap-windows-on-premises">http://robtiffany.com/meap/consumerization-of-it-collides-with-meap-windows-on-premises</a>&#160;</p>
<p>In this week’s scenario, I’ll use the picture below to illustrate how Mobile versions of Windows 7 in the form of slates, laptops, and tablets utilize some or all of Gartner’s Critical Capabilities to connect to Microsoft’s Cloud infrastructure:</p>
<p><a href="http://robtiffany.com/wp-content/uploads/2011/08/image1.png"><img style="background-image: none; border-right-width: 0px; 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://robtiffany.com/wp-content/uploads/2011/08/image_thumb1.png" width="596" height="318" /></a></p>
<p>As you can see from the picture above:</p>
<ol>
<li>For the <strong>Management Tools Critical Capability</strong>, Windows 7 uses Windows Intune for Cloud-based device management and software distribution. </li>
<li>For both the Client and Server <strong>Integrated Development Environment (IDE) and Multichannel Tool Critical Capability</strong>, Windows 7 uses Visual Studio. The Windows Azure SDK plugs into Visual Studio and provides developers with everything they need to build Cloud applications.&#160; It even includes a Cloud emulator to simulate all aspects of Windows Azure on their development computer. </li>
<li>For the cross-platform <strong>Application Client Runtime Critical Capability</strong>, Windows 7 uses .NET (Silverlight/WPF/WinForms) for thick clients. For thin clients, it uses Internet Explorer 9 to provide HTML5 + CSS3 + ECMAScript5 capabilities. Offline storage is important to keep potentially disconnected mobile clients working and this is facilitated by SQL Server Compact + Isolated Storage for thick clients and Web Storage for thin clients. </li>
<li>For the<strong> Security Critical Capability</strong>, Windows 7 provides security for data at rest via Bitlocker, data in transit via SSL, &amp; Authorization/Authentication via the Windows Azure AppFabric Access Control Serivce (ACS). </li>
<li>For the<strong> Enterprise Application Integration Tools Critical Capability</strong>, Windows 7 can reach out to servers directly via Web Services or indirectly through the Cloud via the Windows Azure AppFabric Service Bus to connect to other enterprise packages. </li>
<li>The <strong>Multichannel Server Critical Capability</strong> to support any open protocol is handled automatically by Windows Azure. Crosss-Platform wire protocols riding on top of HTTP are exposed by Windows Communication Foundation (WCF) and include SOAP, REST and Atompub. Cross-Platform data serialization is also provided by WCF including XML, JSON, and OData. Cross-Platform data synchronization if provided by the Sync Framework. These Multichannel capabilities support thick clients making web service calls as well as thin web clients making Ajax calls. Distributed caching to dramatically boost the performance of any client is provided by Windows Azure AppFabric Caching. </li>
<li>As you might imagine, the <strong>Hosting Critical Capability</strong> is knocked out of the park with Windows Azure.&#160; Beyond providing the most complete solution of any Cloud provider, Windows Azure Connect provides an IPSec-protected connection with your On-Premises network and SQL Azure Data Sync can be used to move data between SQL Server and SQL Azure.&#160; This gives you the Hybrid Cloud solution you might be looking for. </li>
<li>For the <strong>Packaged Mobile Apps or Components Critical Capability</strong>, Windows 7 runs cross-platform mobile apps include Office/Lync/IE/Outlook/Bing. </li>
</ol>
<p>As you can see from this and last week’s article, Windows 7 meets all of Gartner’s Critical Capabilities whether it’s connecting to Microsoft’s On-Premises or Cloud servers and infrastructure.&#160; They great takeaway from the picture above, is Windows 7 only needs to know how to integrate its apps with WCF in the exact same way as is does in the On-Premises scenario.&#160; Windows developers can focus on Windows without having to concern themselves with the various options provided by Windows Azure.&#160; Cloud developers just need to provide a WCF interface to the mobile clients. </p>
<p>When an employee walks in the door with a wireless Windows 7 Slate device, you can rest assured that you can make them productive via Windows Azure without sacrificing any of the Gartner Critical Capabilities.</p>
<p>Next week, I’ll cover how Windows Phone connects to an On-Premises Microsoft infrastructure.</p>
<p>Best Regards,</p>
<p>Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/consumerization-of-it-collides-with-meap-windows-cloud/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Server Compact 4.0 Lands on the Web</title>
		<link>http://robtiffany.com/sql-server-compact-4-0-lands-on-the-web/</link>
		<comments>http://robtiffany.com/sql-server-compact-4-0-lands-on-the-web/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 06:31:33 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[SQL Server Compact]]></category>
		<category><![CDATA[.NET Compact Framework]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[MEAP]]></category>
		<category><![CDATA[Merge Replication]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Enterprise Application Platform]]></category>
		<category><![CDATA[RDA]]></category>
		<category><![CDATA[Remote Data Access]]></category>
		<category><![CDATA[SQL CE]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSCE]]></category>
		<category><![CDATA[Sync]]></category>
		<category><![CDATA[Sync Framework]]></category>
		<category><![CDATA[Synchronize]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows CE]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Windows phones]]></category>

		<guid isPermaLink="false">http://robtiffany.com/?p=486</guid>
		<description><![CDATA[With the new version 4.0, the little-database-that-could has grown up into a powerful server database ready to take on the web. <a href="http://robtiffany.com/sql-server-compact-4-0-lands-on-the-web/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A decade has passed since I first started using SQL CE on my Compaq iPAQ.  What started as a great upgrade to Pocket Access turned into the ultimate embedded database for Windows CE, the Pocket PC, Windows Mobile and Windows Phones.  The one-two punch of Outlook Mobile synchronizing email with Exchange and SQL Server Compact synchronizing data with SQL Server helped set the mobile enterprise on fire.  In 2005, version 3.0 supported Windows Tablets and progressive enhancements to the code base led to full Windows support on both x86 and x64 platforms.  With the new version 4.0, the little-database-that-could has grown up into a powerful server database ready to take on the web. </p>
<p>We&#8217;ve come a long way and you&#8217;re probably wondering what qualifies this new embedded database to take on the Internet:</p>
<ul>
<li>Native support for x64 Windows Servers</li>
<li>Virtual memory usage has been optimized to ensure the database can support up to 256 open connections &#8211; (Are you actually using 256 pooled connections with your &#8220;Big&#8221; database today?)</li>
<li>Supports databases up to 4 GB in size &#8211; (Feel free to implement your own data sharding scheme<a href="http://robtiffany.com/wp-content/uploads/2011/01/sqlserver_sql_server_2008_logo.png"><img class="alignright size-medium wp-image-496" title="SQL Server Compact" src="http://robtiffany.com/wp-content/uploads/2011/01/sqlserver_sql_server_2008_logo-300x246.png" alt="SQL Server Compact" width="180" height="148" /></a>)</li>
<li>Developed, stress-tested, and tuned to support ASP.NET web applications</li>
<li>Avoids the interprocess communications performance hit by running in-process with your web application</li>
<li>Row-level locking to boost concurrency</li>
<li>Step up to Government + Military grade security SHA2 algorithm to secure data with FIPS compliance</li>
<li>Enhanced data reliability via true atomicity, consistency, isolation, and durability (ACID) support</li>
<li>Transaction support to commit and roll back grouped changes</li>
<li>Full referential integrity with cascading deletes and updates</li>
<li>Support ADO.NET Entity Framework 4 &#8211; (Do I hear WCF Data Services?)</li>
<li>Paging queries are supported via T-SQL syntax to only return the data you actually need</li>
</ul>
<p>Wow, that&#8217;s quite a list!  SQL Server Compact 4.0 databases are easily developed using the new WebMatrix IDE or through Visual Studio 2010 SP1.  I&#8217;m loving the new ASP.NET Web Pages.  It reminds me of the good old days of building web applications with Classic ASP back in the 90&#8242;s with Visual InterDev and Homesite.</p>
<p>What about Mobility?</p>
<p>Since SQL Server Compact owes its heritage to mobile and embedded versions of Windows, you might be wanting to know what our story is there.  The good news is that you can build and deploy v4.0 databases on Windows XP, Windows Vista, and Windows 7.  If you want to implement an occasionally-connected solution that utilizes the Sync Framework, Remote Data Access (RDA), or Merge Replication, you&#8217;ll need to stick with SQL Server Compact 3.5 SP2.  Time and resource-constraints prevented the Compact team from enabling these features.  Luckily, single-user WPF/WinForms database applications running on Windows Slates, laptops and Windows Embedded Handheld devices will work just fine with the v3.5 SP2 runtime.  Get a jumpstart with this by pickup up &#8220;Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact 3.5 Mobile Merge Replication&#8221; at   <a href="http://www.amazon.com/Enterprise-Synchronization-Microsoft-Compact-Replication/dp/0979891213/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1281715114&amp;sr=1-1">http://www.amazon.com/Enterprise-Synchronization-Microsoft-Compact-Replication/dp/0979891213/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1281715114&amp;sr=1-1</a> to start building those MEAP solutions.</p>
<p>With the tidal wave of Windows Slates hitting the market, a secure, powerful mobile database that allows users to work offline and syncs with SQL Server is definitely going to be a hot item!</p>
<p>So run, don&#8217;t walk to the Microsoft Download site to download the Next-Gen database for the web:</p>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033cfb76-5382-44fb-bc7e-b3c8174832e2">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033cfb76-5382-44fb-bc7e-b3c8174832e2</a></p>
<p>If you need to support occasionally-connected mobile applications with sync capabilities on muliple Windows platforms, download SQL Server Compact 3.5 SP2:</p>
<p><a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e497988a-c93a-404c-b161-3a0b323dce24">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=e497988a-c93a-404c-b161-3a0b323dce24</a></p>
<p>Keep Syncing,</p>
<p>Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/sql-server-compact-4-0-lands-on-the-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Line of Business App Dev :: Moving your WCF REST + JSON Service to Windows Azure</title>
		<link>http://robtiffany.com/windows-phone-7-line-of-business-app-dev-moving-your-wcf-rest-json-service-to-windows-azure/</link>
		<comments>http://robtiffany.com/windows-phone-7-line-of-business-app-dev-moving-your-wcf-rest-json-service-to-windows-azure/#comments</comments>
		<pubDate>Fri, 15 Oct 2010 16:24:12 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[2G]]></category>
		<category><![CDATA[3G]]></category>
		<category><![CDATA[4G]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Azure Development Fabric]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Data Contract]]></category>
		<category><![CDATA[GPRS]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Latency]]></category>
		<category><![CDATA[Operation Contract]]></category>
		<category><![CDATA[Redundancy]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[Scalability]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[SQL Azure]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[UriTemplate]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Web Role]]></category>
		<category><![CDATA[WebClient]]></category>
		<category><![CDATA[WebGet]]></category>
		<category><![CDATA[Wi-Fi]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://robtiffany.com/azure/windows-phone-7-line-of-business-app-dev-moving-your-wcf-rest-json-service-to-windows-azure</guid>
		<description><![CDATA[Ever since my last blog post where I demonstrated how to create lightweight WCF REST + JSON services for consumption by Windows Phone 7, I’ve received many requests from folks wanting to know how to do the same thing from &#8230; <a href="http://robtiffany.com/windows-phone-7-line-of-business-app-dev-moving-your-wcf-rest-json-service-to-windows-azure/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ever since my last blog post where I demonstrated how to create lightweight <strong>WCF REST + JSON</strong> services for consumption by <strong>Windows Phone 7</strong>, I’ve received many requests from folks wanting to know how to do the same thing from <strong>Windows Azure</strong>.&#160; Using <strong>Visual Studio 2010</strong>, the <strong>Azure Development Fabric</strong> and <strong>SQL Server</strong>, I will show you how to move this code to the <strong>cloud</strong>.</p>
<p>Fire up <strong>VS2010</strong> and create a new cloud project (you’ll be prompted to download all the Azure bits if you haven’t done so already). </p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure1" border="0" alt="Azure1" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure1_thumb.png" width="644" height="404" /></a></p>
<p>Select <strong>WCF Service Web Role</strong> and move it over to your <strong>Cloud Service Solution</strong>.&#160; Rename it to <strong>AzureRestService</strong> and click <strong>OK</strong>. </p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure2.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure2" border="0" alt="Azure2" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure2_thumb.png" width="644" height="404" /></a></p>
<p>You’ll then be presented with the default <strong>Service1.svc.cs</strong> SOAP web service that implements the <strong>IService1.cs</strong> Interface.&#160; Needless to say, you’ll need to makes some modifications to these two files as well as <strong>Web.config</strong> if you want to be a true <strong>RESTafarian</strong>. </p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure3.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure3" border="0" alt="Azure3" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure3_thumb.png" width="644" height="404" /></a></p>
<p>In <strong>Service1.svc.cs</strong>, delete the <strong>GetDataUsingDataContract</strong> method but leave the <strong>GetData</strong> method since you’ll use it to perform an initial test. </p>
<p>Next, open <strong>IService1.cs</strong> and delete the <strong>GetDataUsingDataContract [OperationContract]</strong> as well as the <strong>CompositeType [DataContract]</strong>.&#160; You should be left with the simple <strong>GetData [OperationContract]</strong>. </p>
<p>Open <strong>Web.config</strong>.&#160; You’ll notice that it’s already pretty full of configuration items.&#160; After the closing <strong>&lt;/serviceBehaviors&gt;</strong> tag, tap on your Enter key a few times to give you some room to insert some new stuff.&#160; Insert the following just below the closing <strong>&lt;/serviceBehaviors&gt;</strong> tag and just above the closing <strong>&lt;/behaviors&gt;</strong> tag as shown: </p>
<p>&#160;&#160; <font size="1"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </strong></font><font size="1"><strong>&lt;endpointBehaviors&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;behavior name=&quot;REST&quot;&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;webHttp /&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/behavior&gt;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/endpointBehaviors&gt;</strong></font></p>
<p>This provides you with the all-important <strong>webHttp</strong> behavior that enables lean <strong>REST</strong> calls using <strong>HTTP Verbs</strong>.</p>
<p>Below the closing <strong>&lt;/behaviors&gt;</strong> tag and above <strong>&lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&quot;true&quot; /&gt;</strong>, insert the following as shown: </p>
<ul>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font size="1"><strong>&lt;services&gt;          <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;service name=&quot;AzureRestService.Service1&quot;&gt;           <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;endpoint address=&quot;&quot; behaviorConfiguration=&quot;REST&quot; binding=&quot;webHttpBinding&quot; contract=&quot;AzureRestService.IService1&quot; /&gt;           <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/service&gt;           <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/services&gt;</strong></font></p>
</ul>
<blockquote><p>Here is where we define our service <strong>name</strong> and <strong>contract</strong>.&#160; It’s also where we point our <strong>behaviorConfiguration</strong> at the <strong>webHttp</strong> behavior you named <strong>“REST”</strong> and set the binding to <strong>webHttpBinding</strong>.</p>
<p>Now it’s time to decorate your interface’s<strong> [OperationContract]</strong> with a <strong>WebGet</strong> attribute and utilize a <strong>UriTemplate</strong> to give the <strong>Windows Phone 7</strong> caller a web-friendly Uri to call.&#160; So beneath <strong>[OperationContract]</strong> and above string <strong>GetData(int value);</strong>, squeeze in the following:</p>
</blockquote>
<p>&#160;&#160;&#160;&#160;&#160; <strong><font size="1">[WebGet(UriTemplate = &quot;/getdata?number={value}&quot;, BodyStyle = WebMessageBodyStyle.Bare)]</font></strong></p>
<p>Since we want to call the <strong>GetData</strong> method via a <strong>GET</strong> request, we use <strong>WebGet</strong> and then we set our <strong>UriTemplate</strong> to something that anyone could access via their browser.&#160; Lastly, we strip out all unnecessary junk by setting <strong>WebMessageBodyStyle.Bare</strong>.</p>
<p>It’s convenient that I mentioned using a browser to access this new <strong>REST</strong> service because that’s exactly how we’re going to test it.&#160; Hit F5 in <strong>Visual Studio</strong> to fire up the <strong>Azure Development Fabric</strong> and start your <strong>Web Role</strong>.&#160; Internet Explorer will come up and you’ll probably see an Error page because it points to the Root of your <strong>Role Site</strong>.&#160; This is expected behavior.&#160; In order to test the service, type the following in the IE address bar: </p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <a title="http://127.0.0.1:81/service1.svc/getdata?number=5" href="http://127.0.0.1:81/service1.svc/getdata?number=5"><strong>http://127.0.0.1:81/service1.svc/getdata?number=5</strong></a></p>
<p>This points to a loopback address on your computer with a port number of 81.&#160; If your environment uses a different port, then just change what you pasted in as appropriate.&#160; After the port number and “/”, you type in the name of the service you created which is <strong>service1.svc</strong>.&#160; After the next “/”, you type the format you described in the <strong>UriTemplate</strong>.&#160; You can type any Integer you wish and if everything works, the browser will display the following result:</p>
<p><strong>&#160;&#160;&#160; <font size="1">&lt;string xmlns=&quot;http://schemas.microsoft.com/2003/10/Serialization/&quot;&gt;You entered: 5&lt;/string&gt;</font></strong></p>
<p>With your test <strong>REST</strong> service working from your local <strong>Azure Development Fabric</strong>, it’s time to bring over the business logic from my last blog post where I showed you how to return <strong>Customer</strong> information from an on-premise WCF Service connected to <strong>SQL Server</strong>.&#160; I don’t necessarily expect you to have a <strong>SQL Azure</strong> account so you’ll add a connection string to <strong>Web.config</strong> that points to a local <strong>SQL Server Express</strong> instance.&#160; Don’t worry, you can swap this connection string out later to point to our awesome cloud database.&#160; Beneath the closing <strong>&lt;/system.web&gt;</strong> tag and above the <strong>&lt;system.serviceModel&gt;</strong> tag, insert the following:</p>
<p><strong><font size="1">&lt;connectionStrings&gt;        <br />&#160;&#160;&#160; &lt;add name=&quot;ContosoBottlingConnectionString&quot; connectionString=&quot;Data Source=RTIFFANY2\SQLEXPRESS;Initial Catalog=ContosoBottling;Integrated Security=True&quot; providerName=&quot;System.Data.SqlClient&quot; /&gt;         <br />&lt;/connectionStrings&gt;</font></strong></p>
<p>This is the same connection string from the last blog post and you’ll definitely need to modify it to work with both your local <strong>SQL Server</strong> instance and <strong>SQL Azure</strong> when you’re ready to deploy.&#160; Bear with me as the rest of this blog post will be a large Copy and Paste effort.</p>
<p>Open <strong>IService1.cs</strong> and add the following:</p>
<p><strong><font size="1">using System.Collections.ObjectModel;</font></strong></p>
<p>and</p>
<p><strong><font size="1">[OperationContract]        <br />[WebGet(UriTemplate = &quot;/Customers&quot;, BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]         <br />ObservableCollection&lt;Customer&gt; GetCustomers();</font></strong></p>
<p>Open <strong>Service1.svc.cs</strong> and add the following:</p>
<p><strong><font size="1">using System.Web.Configuration;        <br />using System.Collections.ObjectModel;         <br />using System.Data.SqlClient;         <br /></font></strong></p>
<p>&#160;</p>
<p>and</p>
<p><strong><font size="1">//Get the Database Connection string        <br />private string _connectionString = WebConfigurationManager.ConnectionStrings[&quot;ContosoBottlingConnectionString&quot;].ConnectionString;</font></strong></p>
<p>and</p>
<p><strong><font size="1">public ObservableCollection&lt;Customer&gt; GetCustomers()        <br />{         <br />&#160;&#160;&#160; SqlConnection _cn = new SqlConnection(_connectionString);         <br />&#160;&#160;&#160; SqlCommand _cmd = new SqlCommand();         <br />&#160;&#160;&#160; _cmd.CommandText = &quot;SELECT CustomerId, DistributionCenterId, RouteId, Name, StreetAddress, City, StateProvince, PostalCode FROM Customer&quot;;</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160; try        <br />&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; _cn.Open();         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; _cmd.Connection = _cn;</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; ObservableCollection&lt;Customer&gt; _customerList = new ObservableCollection&lt;Customer&gt;();</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; SqlDataReader _dr = _cmd.ExecuteReader();        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; while (_dr.Read())         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Customer _customer = new Customer();         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.CustomerId = Convert.ToInt32(_dr[&quot;CustomerId&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.DistributionCenterId = Convert.ToInt32(_dr[&quot;DistributionCenterId&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.RouteId = Convert.ToInt32(_dr[&quot;RouteId&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.Name = Convert.ToString(_dr[&quot;Name&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.StreetAddress = Convert.ToString(_dr[&quot;StreetAddress&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.City = Convert.ToString(_dr[&quot;City&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.StateProvince = Convert.ToString(_dr[&quot;StateProvince&quot;]);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customer.PostalCode = Convert.ToString(_dr[&quot;PostalCode&quot;]);</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Add to List        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _customerList.Add(_customer);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; return _customerList;         <br />&#160;&#160;&#160; }&#160; <br />&#160;&#160;&#160; finally         <br />&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; _cmd.Dispose();         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; _cn.Close();         <br />&#160;&#160;&#160; }         <br />}</font></strong></p>
<blockquote><p>As you can see, the only remaining error squigglies refer to the lack of the <strong>Customer</strong> class I discussed in the on-premise <strong>WCF</strong> project from the last blog post.&#160; To add it, I want you to right-click on your <strong>AzureRestService</strong> project and select <strong>Add | Class</strong> and name the class <strong>Customer</strong>.</p>
</blockquote>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure4.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure4" border="0" alt="Azure4" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure4_thumb.png" width="644" height="404" /></a></p>
<p>Now I want you to paste the code below into this new class:</p>
<p><strong><font size="1">using System;        <br />using System.Collections.Generic;         <br />using System.Linq;         <br />using System.Web;         <br />using System.Runtime.Serialization;         <br />using System.ComponentModel;</font></strong></p>
<p><strong><font size="1">namespace AzureRestService        <br />{         <br />&#160;&#160;&#160; [DataContract()]         <br />&#160;&#160;&#160; public class Customer : INotifyPropertyChanged         <br />&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public Customer() { }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; private int customerId;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private int distributionCenterId;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private int routeId;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private string name;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private string streetAddress;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private string city;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private string stateProvince;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private string postalCode;</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public int CustomerId         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return customerId; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; customerId = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;CustomerId&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public int DistributionCenterId         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return distributionCenterId; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; distributionCenterId = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;DistributionCenterId&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public int RouteId         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return routeId; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; routeId = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;RouteId&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public string Name         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return name; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;Name&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public string StreetAddress         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return streetAddress; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; streetAddress = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;StreetAddress&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public string City         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return city; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; city = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;City&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public string StateProvince         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return stateProvince; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; stateProvince = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;StateProvince&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; [DataMember()]        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; public string PostalCode         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; get { return postalCode; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; postalCode = value;         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NotifyPropertyChanged(&quot;PostalCode&quot;);         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160;&#160;&#160;&#160;&#160; public event PropertyChangedEventHandler PropertyChanged;        <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; private void NotifyPropertyChanged(String propertyName)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (null != PropertyChanged)         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; PropertyChanged(this, new PropertyChangedEventArgs(propertyName));         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }         <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></strong></p>
<p><strong><font size="1">&#160;&#160;&#160; }        <br />}</font></strong></p>
<p>As I mentioned in the last article, this class is a little overkill since it inherits from <strong>INotifyPropertyChanged</strong> and adds all the code associated with firing <strong>NotifyPropertyChanged</strong> events.&#160; I only do this because you will use this same class in your <strong>Windows Phone 7</strong> project to support two-way data binding.</p>
<p>The <strong>Customer</strong> table you’ll be pulling data from is shown in <strong>SQL Server Management Studio</strong> below:</p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure5.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure5" border="0" alt="Azure5" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure5_thumb.png" width="644" height="376" /></a></p>
<p>We’re now ready to roll so hit F5 in <strong>Visual Studio</strong> to debug this new cloud solution in the <strong>Azure Development Fabric</strong>.&#160; When <strong>Internet Explorer</strong> comes up, type the following in the IE address bar:</p>
<p><a title="http://127.0.0.1:81/service1.svc/customers" href="http://127.0.0.1:81/service1.svc/customers"><strong>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; http://127.0.0.1:81/service1.svc/customers</strong></a></p>
<p>You might be surprised to see the following dialog pop up instead of XML rendered in the browser:</p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure6.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure6" border="0" alt="Azure6" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure6_thumb.png" width="644" height="476" /></a></p>
<p>The reason you see this is because you’re returning the data objects in<strong> wireless-friendly</strong> <strong>JSON format</strong>.&#160; Notice that the dialog say the Unknown file type is only <strong>671 bytes</strong>.&#160; This is a good thing.&#160; Click the Save button and save this file to your desktop.</p>
<p>Now find the customer file on your desktop and rename it to customer.txt so you can view it in <strong>Notepad</strong>.&#160; Double-click on this text box to reveal the tiny, <strong>JSON-encoded</strong> data in <strong>Notepad</strong> that you just looked at in the previous <strong>SQL Server Management Studio</strong> picture.</p>
<p><a href="http://robtiffany.com/wp-content/uploads/2010/10/Azure7.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Azure7" border="0" alt="Azure7" src="http://robtiffany.com/wp-content/uploads/2010/10/Azure7_thumb.png" width="644" height="304" /></a>     </p>
<h3><font style="font-weight: bold">Conclusion</font></h3>
<p>If you followed me through this example and all the code executed properly, you now know how to build <strong>Windows Azure REST + JSON</strong> services designed to conquer those slow, unreliable, and highly-latent wireless data networks we all deal with all over the world.&#160; When combined with my last article, both your <strong>on-premise</strong> and <strong>Windows Azure</strong> bases are covered with <strong>WCF</strong>.&#160; The only thing left to do is sign up for an <strong><a href="http://msdn.microsoft.com/en-us/windowsazure/default.aspx" target="_blank">Windows Azure Platform</a></strong> account and move this <strong>Web Role</strong> and <strong>SQL Azure</strong> database to cloud.&#160; In my next article, I’ll show you how to use the <strong>WebClient</strong> object from <strong>Silverlight</strong> in <strong>Windows Phone 7</strong> to call these services.</p>
<p>Keep coding,</p>
<p>-Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/windows-phone-7-line-of-business-app-dev-moving-your-wcf-rest-json-service-to-windows-azure/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact 3.5 Mobile Merge Replication</title>
		<link>http://robtiffany.com/enterprise-data-synchronization-with-microsoft-sql-server-2008-and-sql-server-compact-3-5-mobile-merge-replication/</link>
		<comments>http://robtiffany.com/enterprise-data-synchronization-with-microsoft-sql-server-2008-and-sql-server-compact-3-5-mobile-merge-replication/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 00:46:53 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Mobile Enterprise Application Platform]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[ISA Server]]></category>
		<category><![CDATA[MEAP]]></category>
		<category><![CDATA[Merge Replication]]></category>
		<category><![CDATA[RDA]]></category>
		<category><![CDATA[Remote Data Access]]></category>
		<category><![CDATA[Reverse Proxy]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Compact]]></category>
		<category><![CDATA[SSCE]]></category>
		<category><![CDATA[Sync]]></category>
		<category><![CDATA[Synchronize]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Windows phones]]></category>

		<guid isPermaLink="false">http://robtiffany.com/?p=62</guid>
		<description><![CDATA[I’m happy to say that my latest book is now available on Amazon. With the world&#8217;s largest organizations rolling out tens of thousands of Windows® phones, laptops, tablets and Netbooks to empower their respective mobile workforces, the ability to create &#8230; <a href="http://robtiffany.com/enterprise-data-synchronization-with-microsoft-sql-server-2008-and-sql-server-compact-3-5-mobile-merge-replication/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’m happy to say that my latest book is now available on <a title="Enterprise Data Synchronization" href="http://www.amazon.com/Enterprise-Synchronization-Microsoft-Compact-Replication/dp/0979891213/ref=sr_1_4?ie=UTF8&amp;s=books&amp;qid=1248893911&amp;sr=1-4" target="_blank">Amazon</a>.</p>
<p>With the world&#8217;s largest organizations rolling out tens of thousands of Windows® phones, laptops, tablets and Netbooks to empower their respective mobile workforces, the ability to create mobile line of business solutions that support large numbers of users is absolutely critical. In my fourth book on mobile infrastructure and development, I show you how to take the SQL Server data you use to run your organization and make it available to all of your mobile employees.</p>
<p>Step-by-step, I’ll walk you through the process of building a secure, performant, n-tier, mobile enterprise application platform architecture designed to scale to thousands of users. You&#8217;ll also learn how to create occasionally-connected .NET applications designed to thrive in unreliable wireless conditions.</p>
<p><a href="http://robtiffany.com/wp-content/uploads/2009/10/CoverSM.png"><img class="aligncenter size-full wp-image-82" title="CoverSM" src="http://robtiffany.com/wp-content/uploads/2009/10/CoverSM.png" alt="Enterprise Data Synchronization with Microsoft SQL Server 2008 and SQL Server Compact=" height="300" /></a></p>
<ul>
<li>Learn how to &#8220;Mobilize&#8221; your organization by making your enterprise data available to employees carrying Windows® phones, laptops, Netbooks and tablets in the field.</li>
<li>Learn how to build an N-Tier Mobile Sync infrastructure that will scale to thousands of users.</li>
<li>Learn how to create occasionally-connected .NET applications designed to thrive in unreliable wireless conditions.</li>
<li>Learn best practices in security, reliability, performance, load-balancing, reverse proxy and hardware configuration.</li>
<li>Learn how to implement this technology in real world scenarios like supply chain management, retail, sales force automation, healthcare and emergency management.</li>
</ul>
<p> </p>
<p>Keep in mind that the knowledge you gain from this book didn’t come from me dreaming this stuff up in an Ivory Tower.  It came from building some of the worlds largest and most complex data synchronization systems for the world’s largest companies.  In addition to the hands-on experience that went into this book, I’d also like to thank some of my colleagues for their invaluable contributions:</p>
<ul>
<li>Liam Cavanagh is a Senior Lead Program Manager for Microsoft’s Sync Framework and Cloud Data Services and he wrote the forward.</li>
<li>Catherine Wyatt is the Managing Editor for Hood Canal Press who made the publishing of the book possible.</li>
<li>Darren Shaffer is the CEO of Handheld Logic and he wrote the Chapter on building the Mobile Subscriber. </li>
<li>Michael Jimenez is a Mobility Architect at Microsoft and he wrote the Appendix that shows you how to create an ISA Server 2006 Reverse Proxy to publish your sync infrastructure to the Internet.</li>
</ul>
<p> </p>
<p>It’s my sincere hope that this book will encourage you to un-tether your workforce from their desktop computers and boost your organization’s agility by pushing out critical business functions to the point of activity where employees are empowered to make timely decisions and perform tasks that best serve the interests of their customers and their company.</p>
<p>This repudiation of the traditional “connected” software application model increases customer satisfaction, boosts worker efficiency, reduces “missed opportunities” and results in cost savings as “un-wired” employees get their jobs done wherever they happen to be.</p>
<p>Best Regards,</p>
<p>Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/enterprise-data-synchronization-with-microsoft-sql-server-2008-and-sql-server-compact-3-5-mobile-merge-replication/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Hidden Message Queue on your Windows phone</title>
		<link>http://robtiffany.com/the-hidden-message-queue-on-your-windows-phone/</link>
		<comments>http://robtiffany.com/the-hidden-message-queue-on-your-windows-phone/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 20:05:26 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[Message Queuing]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[Merge Replication]]></category>
		<category><![CDATA[Message Queue]]></category>
		<category><![CDATA[MSMQ]]></category>
		<category><![CDATA[RDA]]></category>
		<category><![CDATA[Remote Data Access]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Compact]]></category>
		<category><![CDATA[SSCE]]></category>
		<category><![CDATA[Sync]]></category>
		<category><![CDATA[Synchronize]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Windows phones]]></category>

		<guid isPermaLink="false">http://robtiffany.com/?p=8</guid>
		<description><![CDATA[The ability to be “offline” and “occasionally-connected” is a critical component of successful mobile apps.  Wireless data networks lack complete coverage and exhibit a level of unreliability that immediately disqualify permanently-connected apps like you might see on a corporate LAN.  &#8230; <a href="http://robtiffany.com/the-hidden-message-queue-on-your-windows-phone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The ability to be “offline” and “occasionally-connected” is a critical component of successful mobile apps.  Wireless data networks lack complete coverage and exhibit a level of unreliability that immediately disqualify permanently-connected apps like you might see on a corporate LAN.  For a mobile app to be successful, it must allow the user to keep working in the absence of a data network.  It must also be able to transparently sync data changes from the mobile client to the server whenever a wireless data network is detected.  The primary means of accomplishing that today is via one of Microsoft’s sync technologies that allows SQL Server Compact on the mobile client to replicate data to and from SQL Server in the data center or the cloud.  Since SQL Server Compact runs almost anywhere, your mobile client could be a Windows phone, a laptop, a desktop or even a Netbook.</p>
<p>Besides synchronizing the tables, rows and columns of a complete database between mobile clients and servers, the use of message queuing should be considered for many scenarios due to its high-reliability by ensuring that a critical message arrives at its destination.  Products like MSMQ, MQ Series, Tibco and JMS are used all over the world in the most mission-critical environments to ensure a high level of availability and reliability.  They’re asynchronous by nature and use store and forward mechanisms so that messages get from point A to B to C.  A typical queue message includes the <strong>Destination</strong> which tells the messge where to go, a <strong>Label</strong> which describes the message, a <strong>Body</strong> which contains the message, and a <strong>Body Length</strong> so the receiver can verify that it received everything.</p>
<p>So how does any of this relate to Windows phones?  A number of years ago, an MSMQ client was made available for download and installation on Windows phones.  Additionally, the .NET Compact Framework 2.0 included classes to work with MSMQ.  Unfortunately, the installation of MSMQ was far from seamless which inhibited its adoption by customers.  More recently, functionality was included in the .NET Compact Framework 3.5 that facilitated store and forward messaging using Exchange 2007 as a transport.  This is a good solution for customers running the newest version of Exchange, have an unlimited data plan for their phones, and don’t mind running line of business applications over their email infrastructure.</p>
<p>So what do we do for customers that have found the Windows Mobile MSMQ client too much of a hassle, don’t have Exchange 2007 or don’t want to use it as a mobile message queue server?  I think the answer has been under our noses all along.  Burned in the ROM of every Windows Mobile 6.x device is SQL Server Compact + a lightweight data sync solution called Remote Data Access (RDA).  For those of you running Windows Mobile 5, XP, Vista or 7, you can easily download these bits to your mobile client.  SQL Server Compact is you local queue, RDA is your transport and SQL Server in the cloud or data center is your message queue server.  So let’s break this down and see how it will work.</p>
<p>A mobile application that captures data in the field would want to drop that info in a local queue.  SQL Server Compact becomes that local queue and the message format is actually a table with the following structure:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="200" valign="top"><strong>Table name</strong></td>
<td width="200" valign="top">Message</td>
</tr>
<tr>
<td width="200" valign="top"><strong>MessageId</strong></td>
<td width="200" valign="top">Uniqueidentifier</td>
</tr>
<tr>
<td width="200" valign="top"><strong>Destination</strong></td>
<td width="200" valign="top">NVarchar(whatever)</td>
</tr>
<tr>
<td width="200" valign="top"><strong>Label</strong></td>
<td width="200" valign="top">NVarchar(whatever)</td>
</tr>
<tr>
<td width="200" valign="top"><strong>Body</strong></td>
<td width="200" valign="top">NVarchar(4000)</td>
</tr>
<tr>
<td width="200" valign="top"><strong>BodyLength</strong></td>
<td width="200" valign="top">int</td>
</tr>
</tbody>
</table>
<p>This table would be created inside a <strong>MessgeQueue</strong> database in SQL Server and RDA would pull it down to SQL Server Compact.  In the <strong>Pull</strong> method you call from .NET on the client, you would add “<strong>WHERE 1=0</strong>” to the SQL statement.  This filter has the effect of pulling down an empty shell of the table without retrieving any data to the client since that’s all you want.  It also means that when you insert local data into the table and call the <strong>Push</strong> method, the data will be removed from the client at the completion of a successful sync.</p>
<p>So you’re probably wondering, what makes this so special and message queue-like vs. anything else?  The secret is that unlike other sync technologies, RDA can wrap the upload of data into a transaction.  As the data is being uploaded over wireless, if any of the INSERTs into SQL Server fail for whatever reason, everything gets rolled-back and the original data remains in the local SQL Server Compact queue.  This is the kind of guaranteed commit that you expect from a message queuing system.  It’s an “all or nothing” success or rollback. </p>
<p>It actually gets better.  A property of both RDA and Merge Replication is called ConnectionRetryTimeout.  This feature is designed to help you with unreliable wireless coverage where you have signal one minute and then lose it the next.  Let’s say you have this timeout value set to 2 minutes and you begin your <strong>Push</strong> upload of queued data.  Everything is working fine for the first few seconds but then you lose wireless coverage from your mobile operator.  If you regain coverage before the 2 minute time-out, the upload will resume where it left off.  Since both RDA and Merge send and receive data between the SQL Server Compact and IIS in tiny blocks, you never have to worry about running out of memory and you can pick up where you left off in case of a network dropout.</p>
<p>So the big takeaway here is that we do in fact have a<strong> Mobile Message Queue</strong> solution hidden on our Windows phones.  We have a message format that lets us drop text/xml/whatever data into the body, a label that a server process or SQL trigger can key off of to perform an action, and a transactional upload mechanism that ensures your critical data will cross the wireless chasm and make it to the other side intact.</p>
<p>So what’s next?  Now that you can capture data in a local queue and safely upload it, you might be wondering how queued messages from someone else can be pushed to your device.  Don’t worry, that will be in my next post.  Also, this isn’t just an article on how to solve a big problem in the mobile space, I’m actually building the necessary client and server pieces as well.  We’re all looking for a reliable and unified way to connect mobile devices to corporate assets and this just might be the simple answer we’re looking for.</p>
<p>- Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/the-hidden-message-queue-on-your-windows-phone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What ever happened to RDA?</title>
		<link>http://robtiffany.com/what-ever-happened-to-rda/</link>
		<comments>http://robtiffany.com/what-ever-happened-to-rda/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 05:34:47 +0000</pubDate>
		<dc:creator>Rob Tiffany</dc:creator>
				<category><![CDATA[Sync]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[DataSet]]></category>
		<category><![CDATA[DB2]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[MEDC]]></category>
		<category><![CDATA[Merge Replication]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[P2P]]></category>
		<category><![CDATA[RDA]]></category>
		<category><![CDATA[Remote Data Access]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Compact]]></category>
		<category><![CDATA[SSCE]]></category>
		<category><![CDATA[Sync Framework]]></category>
		<category><![CDATA[Sync Services for ADO.NET]]></category>
		<category><![CDATA[Synchronize]]></category>
		<category><![CDATA[Transactional Replication]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[Windows phones]]></category>

		<guid isPermaLink="false">http://robtiffany.com/?p=3</guid>
		<description><![CDATA[Who remembers using Remote Data Access to synchronize data between SQL Server and SQL Server Compact?  I certainly do! Before I dove head first into the world of Merge Replication, I always used RDA to get my customers up and &#8230; <a href="http://robtiffany.com/what-ever-happened-to-rda/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Who remembers using Remote Data Access to synchronize data between SQL Server and SQL Server Compact?  I certainly do!</strong></p>
<p>Before I dove head first into the world of Merge Replication, I always used RDA to get my customers up and running quickly.  Mobilizing an organization’s workforce quickly and easily is what it’s all about so they can start reaping the benefits.  In addition to a speedy time to market, there’s no faster or more scalable mobile sync technology on the market anywhere. </p>
<p><strong>So why wouldn’t I always use RDA?  Here’s a quick list:</strong></p>
<ol>
<li>You’re using Identity columns.</li>
<li>You want to replicate schema changes to the client.</li>
<li>You want change tracking on both the client and server to perform diffs of each of the tables during a sync instead of re-downloading the entire table.</li>
<li>You want to automatically resolve conflicts that arise when 2 people update the same data.</li>
<li>You want referential integrity constraints to be pushed down to the client database from SQL Server.</li>
<li>You don’t want to write code to perform synchronization or filter data.</li>
</ol>
<p>If anything on the above list applied to you, you would shift to Merge Replication because it could manage ranges of Identity columns, push down schema changes, only sync data differences, resolve conflicts and push down a database’s referential integrity constraints.  Merge requires almost no code to get started and tables and columns are filtered visually via a wizard.</p>
<p><strong>So why might you choose to use RDA?  Here’s another list:</strong></p>
<ol>
<li>Your Primary Keys use GUIDs instead of Identity columns.</li>
<li>Users don’t overwrite each other’s data so you don’t need conflict resolution.  The rule of “Last in Wins” works for you.</li>
<li>While you want indexes to be pushed down, you don’t care if your local SSCE database has referential integrity constraints applied.</li>
<li>You want to wrap the changes you upload to SQL Server in a transaction so that all changes are applied or none of them are.</li>
<li>Change tracking on the client is good enough and re-downloading updated server tables doesn’t take too long.</li>
<li>You developers don’t mind writing some sync code.</li>
<li>Be able to execute SQL and Stored Procedures directly against SQL Server via IIS.</li>
<li>You&#8217;re downloading read-only data.</li>
</ol>
<p>If your solution meets the criteria in the list above, you’re probably a good candidate for using RDA instead of Merge.  Are there any other choices out there?</p>
<p>Back at MEDC 2007, we announced a new data replication technology for devices called Occasionally Connected Sync that would sit somewhere between RDA and Merge.  OCS as it used to be called was renamed Sync Services for ADO.NET and then was eventually merged into the Sync Framework. </p>
<p><strong>The Sync Framework is a developer-focused technology:</strong></p>
<ol>
<li>Supports conflict resolution.</li>
<li>Change tracking on the server as well as the client so that only data differences are exchanged.</li>
<li>Peer to Peer sync in the forthcoming v2 of Sync Framework.</li>
<li>Sync with databases other than SQL Server.</li>
<li>Best suited for SSCE running on a desktop or laptop.</li>
</ol>
<p>The clearest differentiation that the Sync Framework has over Merge is its provider model which allows it to sync with other ADO.NET databases like Oracle or DB2.  SQL Server supports built-in P2P Transactional replication and v2 of the Sync Framework will allow you to do this via WCF.  If you development team doesn’t mind writing lots of sync code and needs to support scenarios like synchronizing with other databases from SSCE on the desktop, then the Sync Framework might be the way to go for you.  I wouldn’t yet recommend the Sync Framework for device sync since its wire protocol is currently based on the DataSet which may cause out of memory errors on Windows phones with limited working sets.</p>
<p><strong>So where does this leave RDA?</strong></p>
<p>The reason I’m writing this blog post is because time and time again I run into customer sync scenarios that don’t always need the power of Merge or the extra flexibility of the Sync Framework.  Most field service applications follow the same kind of pattern:</p>
<ol>
<li>Lots of download-only lookup/reference tables that aren’t changed by the user.</li>
<li>Tables that are pushed down to the device that tell a user where to go and what to do.</li>
<li>Tables (sometimes empty) that are used to capture data from the user in the field that are upload-only.</li>
</ol>
<p>These kinds of schemas don’t require conflict resolvers or server change tracking and are therefore well suited for RDA. </p>
<p><strong>What’s the big benefit of using RDA if a sync scenario meets its criteria?</strong></p>
<ol>
<li>You won’t modify SQL Server’s schema with GUIDs and Triggers.</li>
<li>You won’t degrade the performance of SQL Server by having it track changes and maintain extra metadata.</li>
<li>You will have the fastest and most scalable sync solution with least amount of hardware.</li>
<li>Time to market is shorter.</li>
</ol>
<p>The big takeaway here is that I want you to consider your sync solution carefully before choosing a technology.  If your customer’s needs are met by RDA, then you should use it and reap the benefits of developing and deploying a simpler solution with fewer moving parts.</p>
<p><strong>Remember Occam&#8217;s Razor.</strong></p>
<p>-Rob</p>
]]></content:encoded>
			<wfw:commentRss>http://robtiffany.com/what-ever-happened-to-rda/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

