REST and SharePoint 2010 Quick Start Guide

 

Table of Contents for this Series

Yes, I know. REST is simple…but first things first. You have a single development VM containing SharePoint 2010 Beta 2 and you want to experiment with REST but keep getting those painful 404 errors? Ok, here are the basics to setting up REST with SP 2010 Beta 2.

  1. Install ADO.NET Data Services (CTP 2) http://www.microsoft.com/downloads/details.aspx?FamilyID=a71060eb-454e-4475-81a6-e9552b1034fc&displaylang=en

ADO.NET data services is just a piece of the larger pie called WCF Data Services in .NET (note: CPT 2 above is based on .NET v3.5http://msdn.microsoft.com/en-us/data/bb931106.aspx

Note: As of 1/27/2010 ADO.NET Data Services has been updated here ==> http://www.microsoft.com/downloads/details.aspx?familyid=79d7f6f8-d6e9-4b8c-8640-17f89452148e&displaylang=en to SP1

     2.  On your development VM (say on your top level site) identify a list, or lists you want to experiment with.

You can start by just entering the ListData.svc URL as follows (my SharePoint instance is http://win-dcbei0i59th/SitePages/Home.aspx) so I can enter something like http://win-dcbei0i59th/_vti_bin/ListData.svc

 image

       The above result (in atom) returns an enumeration of the lists on my sample site.

   3. ListData.svc is case sensitive so if you want to work with a specific list you need to keep that in mind. For example, to work with the Calendar the URL is

           http://win-dcbei0i59th/_vti_bin/ListData.svc/Calendar   (not calendar)

           to work with the task list use

           http://win-dcbei0i59th/_vti_bin/ListData.svc/Tasks (not tasks)

     4. The general filter syntax for read operations is rather simple, which is great. Here is a sample

           http://win-dcbei0i59th/_vti_bin/ListData.svc/Calendar?$filter=(Title eq ‘TEST2’)

Other parameters exist ($filter,$expand,$orderby,$skip,$top,$metadata) as well as great ways to use this new service, here are a few

http://blogs.msdn.com/vsdata/archive/2009/11/26/integrate-sharepoint-list-data-in-your-wpf-application.aspx

http://blogs.msdn.com/astoriateam/archive/2009/10/21/using-data-services-over-sharepoint-2010-part-1-getting-started.aspx

http://blogs.msdn.com/alexj/archive/2009/12/12/tip-49-how-to-find-your-data-service-bug.aspx

Cheers!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s