Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP.

Similar presentations


Presentation on theme: "Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP."— Presentation transcript:

1 Jon Flanders http://www.rest-ful.net/ INT303

2 About Me  Jon Flanders – http://www.rest-ful.net/  Independent consultant/trainer  BizTalk MVP

3 3 Storytime: Once upon time…

4 4 REST Representational State Transfer introduced by Roy Fielding Architectural style A set of constraints distilled from the architecture of the Web URIs represent resources Clients interact via with resources via a uniform interface (GET, POST, PUT, DELETE) Services are stateless

5 5 Why should you care? Microsoft Live Services.NET Services ADO.NET Data Services EVERYBODY that isn’t Microsoft (Twitter,Google, Yahoo, Facebook, MySpace) More to come from Microsoft and others – but why let them have all the fun (and rewards)?

6 6 REST Advantages GET responses can be cached Using URIs build on experience using the Web Uniform interface simplifies building and using services Statelessness constraint eases scalability GET is safe, can be called N times without causing change PUT and DELETE are idempotent (same effect no matter how many times called)

7 7 Building a RESTful service Design your resource(s) Determine the URI for each resource Determine what part of the uniform interface each resource should implement

8 8 Uniform Interface

9 9 Windows Communication Foundation (WCF) Framework for building applications that communicate Client-Server Message oriented Service oriented WCF abstracts away network complexities, developer concentrates on code Most of WCF is highly geared toward SOAP REST support added in 3.5 and improved in 3.5 sp1

10 10 WCF Messages to Methods In WCF developers write methods in classes that respond to network messages SOAP support in 3.0/3.5 routes messages to methods based on SOAP Action URI always the same Always uses POST Done by the default dispatcher

11 11 WCF 3.5 Web Programming Messages are routed to methods based on: URI HTTP Verb Same programming model as “SOAP” ServiceContract, OperationContract, DataContract New dispatcher that maps URIs/Verbs to methods

12 12 WCF 3.5 REST infrastructure UriTemplate & UriTemplateTable URI parsing WebGet & WebInvoke attributes UriTemplate defines URI WebGet + UriTemplate maps GET requests to methods WebInvoke + UriTemplate maps remainder of uniform interface to methods, Method property determines verb (POST is default) WebHttpBinding/WebServiceHost/WebServiceH ostFactory Eases use and configuration

13 WCF Dispatching Network Message Transport Channel Message Encoder Protocol Channel (1-N) Your Code Dispatcher (Action) Dispatcher (Action) Dispatcher (URI + VERB) Dispatcher (URI + VERB) Transport Channel (HTTP) Transport Channel (HTTP) Message Encoder (Text + No SOAP) Message Encoder (Text + No SOAP)

14 14 AJAX Support Many RESTful clients are JavaScript based AJAX clients JavaScript Object Notation (JSON) is the preferred resource representation Smaller footprint than XML No parsing necessary WCF has support for AJAX applications at two levels JSONDataContractSerializer for JSON parsing and generation JavaScript “proxy” build on ASP.NET AJAX

15 15 Web Feeds Web Feeds are endpoints that expose machine consumable resource representations Commonly used for web logs (blogs), news etc. Expansion into enterprise data is happening

16 16 WCF support for Feeds Built on top of WCF REST support (WebGet/UriTemplate) Feed specific feature is feed-format neutral object model Transform your data into the WCF OM OM serialized to either RSS or Atom (or other future formats – extensible formatting capabilities) OM is closer to Atom model (Atom is richer than RSS)

17 17 Know the rules, bend when necessary “…REST isn’t an all or nothing proposition. One can get significant value from partial adoption. “ Sam Ruby - Author RESTFul Web Services Don’t underestimate the power of GET!

18 18 Summary REST is an architectural style that encourages interoperable, scalable web services Builds on the existing architecture of the web WCF 3.5 adds support for this architecture

19 Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!

20 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide


Download ppt "Jon Flanders INT303. About Me  Jon Flanders –  Independent consultant/trainer  BizTalk MVP."

Similar presentations


Ads by Google