LinkedIn

Tuesday, December 10, 2013

SharePoint : Representational State Transfer (REST)

The SharePoint 2010 Representational State Transfer (REST) interface is a WCF Data Service that allows you to use construct HTTP requests to query SharePoint list data. Representational State Transfer, aka REST, is an architectural style for web-based data access, an alternative to other techniques like SOAP Web Services and Remote Procedure Calls. OData is a protocol – a standardized way to implement REST to surface, query, and manipulate data. OData is an open web-data protocol developed by Microsoft. OData is all about web-based data access; OData can make almost any kind of structured data collection available to any kind of platform, because all data access is via plain old HTTP, and the data is served up as XML (or JSON) in an Atom-style RSS feed.
ODataQuery by URL, Answer by RSS
OData is built on the Entity Data Model. A RDBMS like SQL Server, tables contain rows; in OData, Collections contain Entries. In a database, tables can be related; in OData, Collections can be associated. A row has columns. An Entry has properties. Tables may have keys; Collections always have keys. Browsing to the service root of an OData service usually displays an Atom+XML list of all available Collections.
Entity Data Model (EDM) and OData have parallel terms:
EDM (What to query)
OData (What is returned)
Entity Set
Collection
Entity Type
Entry
Property of an Entity Type
Property of an Entry
Navigation Property
Link
Function Import
Service Operation
An OData Url has three parts: a Service root, a resource path, and (optionally) query string options. We”ve seen the service root, which typically returns a list of all available Collections. The resource path is kind of like a relative URL, and identifies a Collection or a single Entry or a property of an Entry. Basically the resource path drills down through the entity model to get to a particular object. OData URLs are usually case-sensitive, so take care with spelling. For example, http://services.odata.org/Northwind/Northwind.svc/Customers(”ALFKI”) returns just the ALFKI Customer, which is a single Entry identified by its key

Reference:

http://www.mindsharp.com/blog/2012/07/sharepoints-rest-an-odata-overview/

No comments:

Post a Comment