<?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>Pablo Castro's blog : REST</title><link>http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx</link><description>Tags: REST</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Every SharePoint 2010 server is a Data Services server</title><link>http://blogs.msdn.com/pablo/archive/2009/10/19/every-sharepoint-2010-server-is-a-data-services-server.aspx</link><pubDate>Tue, 20 Oct 2009 06:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9909690</guid><dc:creator>pabloc</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/pablo/comments/9909690.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=9909690</wfw:commentRss><description>&lt;P&gt;I haven't been writing much here, mostly because I've been way too busy but also because I couldn't discuss publicly many of the things I'm doing. Now that &lt;A href="http://www.microsoft.com/presspass/press/2009/oct09/10-19MSSharePointConf09PR.mspx" target=_blank mce_href="http://www.microsoft.com/presspass/press/2009/oct09/10-19MSSharePointConf09PR.mspx"&gt;SharePoint 2010 has been announced&lt;/A&gt; and its feature set published everywhere, I can finally discuss one of the coolest things we've been up to lately.&lt;/P&gt;
&lt;P&gt;SharePoint is a repository of resources (list items and documents in document libraries) that are collected and manipulated collaboratively. Resources have a bunch of security and business logic attached to them, such as who can see each item, who gets to change it, or whether a particular column in a list needs to conform to a particular validation formula. &lt;/P&gt;
&lt;P&gt;When SharePoint folks said they wanted a RESTful interface this was great news...the system is just a perfect fit. Not only it's a perfect fit for RESTful services in general, but also for Astoria in particular. In the end SharePoint is very data-centric in nature, it already supports queries and business logic as part of the uniform interface.&lt;/P&gt;
&lt;P&gt;So we're really excited to announce that as of SharePoint 2010, every SharePoint server is an Astoria server out of the box. No configuration required or anything, just make sure the proper version of ADO.NET Data Services is in the box. For SharePoint 2010 beta, the "right" version is &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a71060eb-454e-4475-81a6-e9552b1034fc&amp;amp;displaylang=en" target=_blank mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=a71060eb-454e-4475-81a6-e9552b1034fc&amp;amp;displaylang=en"&gt;ADO.NET Data Services v1.5 CTP2&lt;/A&gt;. We'll put details out there for future iterations as they come.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/astoriateam/archive/2009/10/19/share-your-data-across-data-sources-sharepoint-sql-server-azure-reporting-services-etc-applications-net-silverlight-excel-etc-using-data-services.aspx" target=_blank mce_href="http://blogs.msdn.com/astoriateam/archive/2009/10/19/share-your-data-across-data-sources-sharepoint-sql-server-azure-reporting-services-etc-applications-net-silverlight-excel-etc-using-data-services.aspx"&gt;Official write up&lt;/A&gt; in the Astoria team blog.&lt;/P&gt;
&lt;P&gt;The SharePoint Data Service head is not just a side integration deal, it's a full-on REST-over-HTTP head for SharePoint. It supports browsing as well as modifying data using regular HTTP verbs (GET, PUT, DELETE, etc.), it does ETags for concurrency control, enforces business logic as part of side-effecting methods, and it handles the full range of Data Services conventions for URLs, Atom and JSON payload formats, etc. It also exposes full metadata like any other Astoria service, allowing Visual Studio and any other metadata-driven client to give you a great experience on the client side. Now if you need to get or manipulate data in SharePoint from any platform in any language, all you need is an HTTP stack.&lt;/P&gt;
&lt;P&gt;The other cool aspect is that the SharePoint folks where able to build this entirely on top of public bits, using our new fancy provider model for advanced data sources I &lt;A href="http://blogs.msdn.com/pablo/archive/2008/11/01/ado-net-data-services-in-windows-azure-pushing-scalability-to-the-next-level.aspx" target=_blank mce_href="http://blogs.msdn.com/pablo/archive/2008/11/01/ado-net-data-services-in-windows-azure-pushing-scalability-to-the-next-level.aspx"&gt;discussed here&lt;/A&gt; some time ago.&lt;/P&gt;
&lt;P&gt;SharePoint joins a growing family of Microsoft products that enable users to share data through the use of a simple RESTful interface that follows the Astoria conventions when needed (e.g. URLs, structured data in Atom). Another example on the server side include SQL Server Reporting Services, which in SQL Server 2008 R2 can now render any report as Atom feed that follows the Astoria conventions (examples &lt;A href="http://blogs.msdn.com/gemini/archive/2009/09/24/data-feeds.aspx" target=_blank mce_href="http://blogs.msdn.com/gemini/archive/2009/09/24/data-feeds.aspx"&gt;here&lt;/A&gt;). On the client, in addition to developer-oriented options such as .NET, Silverlight, AJAX, PHP, Java and more, we now also have &lt;A href="http://www.powerpivot.com/" target=_blank mce_href="http://www.powerpivot.com/"&gt;PowerPivot&lt;/A&gt; (f.k.a. Gemini) which can pull data from any data service and do fancy analysis and publishing over it, making it trivial to bring data from Data Services into Microsoft Excel 2010 among other things.&lt;/P&gt;
&lt;P&gt;I find this to be extremely important. A simple, uniform way of sharing data at the protocol level, and in a way that truly enables the lowest possible bar of entry, is key to enable broad integration across products and break data silos that form around applications.&lt;/P&gt;
&lt;P&gt;I'll be talking about this at the &lt;A href="http://www.mssharepointconference.com/" target=_blank mce_href="http://www.mssharepointconference.com"&gt;SharePoint conference 2009&lt;/A&gt;&amp;nbsp;in Las Vegas this week, and at the &lt;A href="http://microsoftpdc.com/" target=_blank mce_href="http://microsoftpdc.com/"&gt;Professional Developer Conference (PDC 2009)&lt;/A&gt; in late November. If you're attending any of these and this sounds interesting, these sessions will drill into plenty of details.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909690" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Conferences/default.aspx">Conferences</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx">REST</category><category domain="http://blogs.msdn.com/pablo/archive/tags/SharePoint/default.aspx">SharePoint</category></item><item><title>PHP toolkit for ADO.NET Data Services</title><link>http://blogs.msdn.com/pablo/archive/2009/08/21/php-client-for-ado-net-data-services.aspx</link><pubDate>Fri, 21 Aug 2009 19:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9878948</guid><dc:creator>pabloc</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/pablo/comments/9878948.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=9878948</wfw:commentRss><description>&lt;P&gt;Folks in the interoperability team at Microsoft just announced something they've been cooking for a while, developed&amp;nbsp;&lt;A href="http://www.persistentsys.com/" mce_href="http://www.persistentsys.com/"&gt;Persistent Systems&lt;/A&gt;: a client PHP toolkit for Astoria services. It follows more or less the model of the .NET client where you can run a tool during development to get code-gen based on a data service metadata, and then it has a runtime library that can be used to send queries, obtain responses as PHP objects, track and submit changes, etc. They implemented both the Atom and JSON formats, and even threw in batching support. &lt;/P&gt;
&lt;P&gt;The best part is that it's all written in PHP (both code-gen tool and runtime), so it runs in any environment where PHP and the toolkit dependencies (XML, XSLT, CURL) are available.&lt;/P&gt;
&lt;P&gt;For more details check out the &lt;A href="http://blogs.msdn.com/interoperability/archive/2009/08/21/a-new-bridge-for-php-developers-to-net-through-rest-php-toolkit-for-ado-net-data-services.aspx" mce_href="http://blogs.msdn.com/interoperability/archive/2009/08/21/a-new-bridge-for-php-developers-to-net-through-rest-php-toolkit-for-ado-net-data-services.aspx"&gt;post in the interoperability team's blog&lt;/A&gt;, the kick off&amp;nbsp;&lt;A href="http://channel9.msdn.com/posts/jccim/Consuming-data-over-the-web-between-PHP-and-NET-with-REST-and-ADONET-Data-Services/" mce_href="http://channel9.msdn.com/posts/jccim/Consuming-data-over-the-web-between-PHP-and-NET-with-REST-and-ADONET-Data-Services/"&gt;Channel 9 video&lt;/A&gt;, and the &lt;A href="http://phpdataservices.codeplex.com/" mce_href="http://phpdataservices.codeplex.com/"&gt;PHP toolkit project&lt;/A&gt; in codeplex.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9878948" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx">REST</category></item><item><title>Adding support for JSONP and URL-controlled format to ADO.NET Data Services</title><link>http://blogs.msdn.com/pablo/archive/2009/02/25/adding-support-for-jsonp-and-url-controlled-format-to-ado-net-data-services.aspx</link><pubDate>Thu, 26 Feb 2009 06:29:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9445482</guid><dc:creator>pabloc</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/pablo/comments/9445482.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=9445482</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/" target="_blank"&gt;JSONP&lt;/a&gt; is a common way of making data accessible in client-side mashups even when the requests need to be cross-domain.&lt;/p&gt;  &lt;p&gt;While the current version of the ADO.NET Data Services framework does not support this, it’s possible to build it on top. There are a couple of ways of doing this. Here is what’s probably the simplest way. There is some downsides to this approach, but overall is the most straightforward path to get there.&lt;/p&gt;  &lt;p&gt;The default transport layer for Data Services is WCF, which has a many extensibility points across the stack. For the case of JSONP support, IDispatchMessageInspector comes in handy.&lt;/p&gt;  &lt;p&gt;There are two things needed to support JSONP properly:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The ability to control the response format. Data Services uses standard HTTP content type negotiation to select what representation of a given resource should be sent to the client (e.g. JSON, Atom). That requires that the caller can set the Accept request header, which is not possible when doing the JSONP trick (which basically just uses &amp;lt;script&amp;gt; tags). We need to add the ability to use the query string in the URL to select format. (e.g. /People(1)/Friends?$orderby=Name&amp;amp;&lt;strong&gt;$format=json&lt;/strong&gt;). &lt;/li&gt;    &lt;li&gt;A new option to wrap the response in a callback if such callback was provided in the request (also in the query string). For example /People(1)/Friends?$orderby=Name&amp;amp;$format=json&amp;amp;&lt;strong&gt;$callback=loaded&lt;/strong&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;What we’ll do is register a message inspector and adjust the request/response when we see these new options coming in.&lt;/p&gt;  &lt;p&gt;In order to support the $format=json option we can intercept the message before it gets dispatched to the Astoria runtime, at the IDispatchMessageInspector.AfterReceivedRequest method. If we see the query string option then we’ll a) strip it out from the URL so Data Services does not generate an error and b) change the “Accept” header to “application/json”, so the rest of the system just thinks that the client asked for a JSON response in the first place.&lt;/p&gt;  &lt;p&gt;For the second part, where we need to wrap the response into a Javascript call if the $callback option was used, we have the IDispatchMessageInspector.BeforeSendReply method which gives us the perfect spot to rewrite the response. One unfortunate side-effect of this is that the response will get buffered and re-encoded; that said, in many cases this won’t make any noticeable difference.&lt;/p&gt;  &lt;p&gt;Finally, we need to register the interceptor with WCF’s dispatchers. For that we create an attribute that implements IServiceBehavior, so we get called during service initialization. When we get called we can register our message interceptor.&lt;/p&gt;  &lt;p&gt;The net effect is that if you include this code in your project, you just need to add a single attribute to your Data Service to make it support JSONP:&lt;/p&gt;  &lt;p&gt;[JSONPSupportBehavior]    &lt;br /&gt;public class SampleService : DataService&amp;lt;ContactsData&amp;gt;     &lt;br /&gt;{     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; // your service code here...     &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt;Once that's in place you can use JSONP by adding $format and $callback to URLs, for example: &lt;/p&gt;  &lt;p&gt;http://&amp;lt;host&amp;gt;/SampleService.svc/People?$format=json&amp;amp;$callback=cb&lt;/p&gt;  &lt;p&gt;Of course, you can still use all the other Data Services URL options in addition to these.&lt;/p&gt;  &lt;p&gt;The implementation and a small sample service are available at MSDN code gallery, here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://code.msdn.microsoft.com/DataServicesJSONP" href="http://code.msdn.microsoft.com/DataServicesJSONP"&gt;http://code.msdn.microsoft.com/DataServicesJSONP&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;-pablo&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9445482" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Web/default.aspx">Web</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx">REST</category></item><item><title>REST and Concurrency Control</title><link>http://blogs.msdn.com/pablo/archive/2008/04/22/rest-and-concurrency-control.aspx</link><pubDate>Wed, 23 Apr 2008 04:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8417689</guid><dc:creator>pabloc</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/pablo/comments/8417689.aspx</comments><wfw:commentRss>http://blogs.msdn.com/pablo/commentrss.aspx?PostID=8417689</wfw:commentRss><description>&lt;P&gt;As part of the Astoria design process we scanned through many topics, some of them are straightforward, some are hard but mostly mechanical, but there are some that become interesting, fundamental aspects to address.&lt;/P&gt;
&lt;P&gt;I found the problem of concurrency control over REST interfaces very interesting to explore. The problem is actually well addressed in HTTP so it wasn't that we had to invent a bunch of stuff. It was more about learning what was out there, reading about good/bad stories, and then mapping it to our model and see how it fitted.&lt;/P&gt;
&lt;P&gt;In the end we landed on what I think is a quite nice place. If you're interested, check out &lt;A class="" href="http://blogs.msdn.com/astoriateam/archive/2008/04/22/optimistic-concurrency-data-services.aspx" mce_href="http://blogs.msdn.com/astoriateam/archive/2008/04/22/optimistic-concurrency-data-services.aspx"&gt;this write up&lt;/A&gt; in the Astoria team blog on the topic.&lt;/P&gt;
&lt;P&gt;-pablo&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8417689" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/pablo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Astoria/default.aspx">Astoria</category><category domain="http://blogs.msdn.com/pablo/archive/tags/Services/default.aspx">Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/ADO.NET+Data+Services/default.aspx">ADO.NET Data Services</category><category domain="http://blogs.msdn.com/pablo/archive/tags/REST/default.aspx">REST</category></item></channel></rss>