Building RESTful Applications with OData
Upcoming SlideShare
Loading in...5
×
 

Building RESTful Applications with OData

on

  • 11,497 views

Applications today are expected to expose their data and consume data-centric services via REST. In this session we discuss what REST is and have an overview of WCF Data Services and see how we can ...

Applications today are expected to expose their data and consume data-centric services via REST. In this session we discuss what REST is and have an overview of WCF Data Services and see how we can REST enable your data using the Open Data Protocol (OData). Then you will learn how to leverage existing skills related to Visual Studio, LINQ and data access to customize the behavior, control-flow, security model and experience of your data service. We will then see how to enable data-binding to traditional ASP.NET controls as well as Silverlight and Excel PowerPivot. We’ll then turn to consuming SharePoint and other OData based applications in .NET as well as from a non-Microsoft client. This is a very demo intensive session.

Statistics

Views

Total Views
11,497
Views on SlideShare
11,495
Embed Views
2

Actions

Likes
3
Downloads
190
Comments
0

1 Embed 2

http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Building RESTful Applications with OData Building RESTful Applications with OData Presentation Transcript

  • Building RESTful Applications with the Open Data Protocol Todd Anglin Chief Evangelist, Telerik Level: Intermediate
  • Introductions
    • Todd Anglin
    • Chief Evangelist, Telerik
    • Microsoft MVP
    • ASP Insider
    • President NHDNUG & O’Reilly Author
    @toddanglin TelerikWatch.com
  • The Plan
  • What you should learn today:
    • What is REST/OData
    • Who created REST/OData
    • Why use REST/OData
    • When should you use REST/OData
    • Where can you find REST/OData
  • How did we get here?
  • “ There is a vast amount of data available today and data is now being collected and stored at a rate never seen before. Much, if not most, of this data however is locked into specific applications or formats and difficult to access or to integrate into new uses.”  - OData.org
  • State of Data & Services Internal SQL My App App Data CMS Share Point Cloud Custom API SQL JSON Services FB
  • What is REST?
    • Re presentational S tate T ransfer
    • What is the biggest REST implementation?
      • World Wide Web!
    REST is NOT a standard! (But it uses standards) HTTP + URLs + XML*
  • REST Principles
  • REST Illustrated Magic Kingdom (Resource) http://disneyworld.com/parks/magic-kingdom Resource URL Representation URL Click (State Transfer) Representation
  • RESTful Services
    • Core idea:
    let's have computers use the web the way humans do
  • Alternatives to REST
    • Most common: SOAP and RPC
    • Why use SOAP (vs REST)?
      • Enterprise security features (WS-Security)
      • ACID Transactions (WS-AtomicTransaction)
      • Message error recovery (WS-ReliableMessaging)
    SOAP services focus on exposing application logic REST services focus on exposing “data” (or CRUD operations on data)
    • OData
    does for data what REST does for services
  • (Finally!) What is OData?
    • HTTP
      • REST-based services
    • AtomPub
      • Data structure
    • JSON
      • Data delivery format
    Data silo buster
  • What do web services require?
    • A way to discover a service provider
    • A way to discover available services at a provider
    • A way to describe how to interface with service
    • A way to execute functions provided by a service
    • A standard messaging format
    • A way to represent the data in exchange
  • Why?
    • Interoperability
      • Predictable access to data from any system
    • Gaining popularity
      • SharePoint 2010
      • SQL Server 2008 R2
      • IBM WebSphere eXtreme Scale
      • Azure Table Storage
      • Telerik TeamPulse
  • REST AND ODATA IN ACTION
    • DEMO
  • Consuming OData
    • Windows Phone 7 / iPhone / Mobile
    • AJAX / Javascript
    • PHP / Java / .NET
    • Silverlight
    • PowerPivot
    • Simple HTTP Requests (GET, POST, PUT, DELETE)
    • More…
  • Visual Studio Tools
    • Open Data Protocol Visualizer
  • CONSUMING EXISTING ODATA
    • DEMO
  • Creating OData Service
    • As simple as returning proper XML/JSON
      • No specific platform requirements
    • Ways to build:
      • Using Visual Studio tools (WCF Data Services)
      • SharePoint Lists
      • Azure Table Storage
      • Manually produce XML
  • WCF Data Services (Astoria)
    • Build RESTful services on Microsoft platform
      • Roots of OData protocol
    • Built on WCF
      • Supports ATOM (XML) and JSON data representations
    • Automates REST for data
      • Anything that implements IQueryable<T> or IUpdatable<T>
      • EX: EF, LinqToSQL, 3 rd party ORM, etc.
  • WCF DATA SERVICES BASICS
    • DEMO
  • Service Operations
    • Functions exposed by OData
      • Similar to RPC
      • Accept zero or more primitive type input params
      • Can return scalar value
      • [WebGet] is used for an addressable query
      • [WebInvoke] is used for insert, update, and delete
    http://.../OData.svc/ GetProductsByRating ?rating=5
  • Interceptors
    • Query Interceptors
      • Logic runs when resource is requested
      • Uses: limit the data viewed, log, perform security check
    • Change Interceptors
      • Logic runs when a change (Add/Edit/Delete) request is made (HTTP PUT/POST/DELETE)
  • SERVICE OPS & INTERCEPTORS
    • DEMO
  • Securing Data Services
    • Remember!
      • REST is NOT a protocol, it’s a pattern
    • Same security that applies to HTTP, AtomPub, JSON
    • Other options:
      • EntitySetRights
      • Hiding sensitive data with [IgnoreProperties]
      • Infrastructure security – SSL, IP Filtering
      • QueryInterceptors
  • OData & SharePoint 2010
    • ListData.svc
      • Out-of-the-box OData access to SharePoint data
      • Data is NOT anonymously available!
    http://siteurl /_vti_bin/listdata.svc /Announcements
  • When to REST?
    • Stateless web services
    • Scalable web services (via HTTP caching)
    • Mutually understood context (OData)
    • Restricted bandwidth (Mobile)
    Always, except when there is a reason NOT to REST
  • [Q & A]
    • Thanks! Gracias! Mersi! Blagodarya!
    @toddanglin telerikwatch.com [email_address]