Representational State Transfer (REST) is defined as an architectural style, which means that it is not a concrete systems architecture, but instead a set of constraints that are applied when designing a systems architecture. We briefly discuss these constraints, but then focus on explaining how the Web is one such systems architecture that implements REST. In particular, the mechanisms of the Uniform Resource Identifiers (URIs), the Hypertext Transfer Protocol (HTTP), media types, and markup languages such as the Hypertext Markup Language (HTML) and the Extensible Markup Language (XML). We also introduce Atom and the Atom Publishing Protocol (AtomPub) as two established ways on how RESTful services are already provided and used on today's Web.
OData: A primer for iOS developers Glen Gordon Developer Evangelist Microsoft Corporation http://glengordon.name @glengordon
Agenda The case for OData A look at the format Producers, services and consumers Resources and tips
OData Uniform way of representing structured data Atom, JSON formats Uniform URI conventions Navigation, filtering, sorting, paging, etc. Uniform operations Addressability GET, POST, PUT, DELETE always mean the same
REST: 3 definitions An architectural style for building loosely coupled systems defined by a set of very general constraints (principles) the Web (URI/HTTP/HTML/XML) is an instance of this style The Web used correctly (i.e., not using the Web as transport) HTTP is built according to RESTful principles services are built on top of Web standards without misusing them most importantly, HTTP is an application protocol (not a transport protocol) Anything that uses HTTP and XML (XML without SOAP) XML-RPC was the first approach for this violates REST because there is no uniform interface
The name Atom applies to a pair of related standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub) is a simple HTTP-based protocol for creating and updating web resources. ATOMPub
http://services.odata.org/OData/OData.svc _______________________________________/ | service root URI http://services.odata.org/OData/OData.svc/Category(1)/Products?$top=2&$orderby=name _______________________________________/ __________________/ _________________/ | | | service root URI resource path query options What is a URI?
Examples http://services.odata.org/OData.svc/GetProductsByRating?rating=5 Identifies the "GetProductsByRating" Service Operation and specifies a value of 5 for the "rating" input parameter. Service Operations(Functions)
OData Producers Windows Communication Foundation (WCF) SharePoint 2010 IBM WebSphere SQL Azure Windows Azure Table Storage SQL Server Reporting Services Microsoft Dynamics CRM 2011 GeoREST Build your own
OData Services ebay Netflix Twitpic Windows Live NerdDinner Open Government Data Initiative Open Science Data Initiative Windows Azure Marketplace DataMarket
OData Consumers – End Users Web Browsers Excel 2010 OData Explorer