1 / 24

Web 2.0: Building Data Driven RESTful Applications with Microsoft Tools

Web 2.0: Building Data Driven RESTful Applications with Microsoft Tools. Stephen Forte stevef@orcsweb.com http://stephenforte.net. http://speaker/( ‘forte ’)/bio. Chief Strategy Officer of Telerik Certified Scrum Master Active in the Community:

kreeli
Télécharger la présentation

Web 2.0: Building Data Driven RESTful Applications with Microsoft Tools

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web 2.0: Building Data Driven RESTful Applications with Microsoft Tools Stephen Forte stevef@orcsweb.comhttp://stephenforte.net

  2. http://speaker/(‘forte’)/bio • Chief Strategy Officer of Telerik • Certified Scrum Master • Active in the Community: • International Conference Speaker for 12+ Years • RD, MVP and INETA Speaker • Co-moderator & founder of NYC .NET Developers Group http://www.nycdotnetdev.com • Wrote a few books: SQL Server 2008 Developers Guide (MS Press) • MBA from the City University of New York • Past: • CTO and co-Founder of Corzen, Inc. (TXV: WAN) • CTO of Zagat Survey

  3. Agenda • What is REST? • What is ADO .NET Data Services (Astoria)? • Consuming ADO .NET Data Services Data • Futures: WCF REST Starter Kit, Astoria Offline

  4. Agenda • What is REST? • What is ADO .NET Data Services (Astoria)? • Consuming ADO .NET Data Services Data • Futures: WCF REST Starter Kit, Astoria Offline

  5. What is REST? • Representational State Transfer • An architectural style developed by Roy Fielding • Resource based not RPC based • Based on HTTP • Standard resource formats • Stateless communication between client and server • GET, POST, PUT, DELETE • Addressable resources + hyperlinking http://example.com/users/ http://example.com/users/{user} http://example.com/locations/ http://example.com/locations/{location}

  6. Web Services v REST Web Services REST HTTP only Resource Focused URI Based XML, RSS, ATOM, XHTML, JSON, and others • Protocol Independent • RPC Focused • Method (Action) Based • XML Based (SOAP)

  7. Agenda • What is REST? • What is ADO .NET Data Services (Astoria)? • Consuming ADO .NET Data Services Data • Futures: WCF REST Starter Kit, Astoria Offline

  8. ADO .NET Data Services • Framework from Microsoft that that facilitates the creation of RESTful data services via HTTP endpoints • Shipped with .NET 3.5 SP1 • Built on top of WCF • Data representation in ATOM or JSON • Automates the exposure of data as RESTful resources • Anything that implements IQueryable<T> and IUpdatable<T> • Entity Framework • 3rd party ORMs • LINQ to SQL, custom data driven CLR classes • Custom URI based querying

  9. Demo-ADO .NET Data Services Walk Through

  10. Service Operations • Additional way to expose resources via URIs • [WebGet] is used for an addressable query • [WebInvoke] is used for insert, update, and delete • Can return a scalar value • IEnumerable or IQueryable • Astoria’s URI exposes the Service Operation • If you use IQueryable you can append query strings to the URI

  11. Data Interceptors • Query Interceptors • Logic that will run when a resource is requested • Can be used to limit the data viewed, log, or perform security check • Change Interceptors • Logic that will run when a change (Add/Edit/Delete) request is made

  12. Demo-Service Operations, Query Interceptors

  13. Securing ADO .NET Data Services • Using the Host’s authentication model • Role based authorization • EntitySetRights • Hiding Sensitive Data • [IgnoreProperties] • QueryInterceptors • ServiceOperations to validate users • Brute force: HTTPS, SSL, IP Filtering • SQL Server Security should not be ignored either!

  14. Agenda • What is REST? • WCF REST Starter Kit • What is ADO .NET Data Services (Astoria)? • Consuming ADO .NET Data Services Data • Futures: Astoria Offline

  15. Programming ADO.NET Data Services • Client side querying via LINQ to ADO .NET Data Services • Proxy • Non Proxy • HTTP Requests for non-Microsoft .NET Clients • GET • POST • PUT • DELETE

  16. Programming from ASP .NET • Server Side • Generate a Proxy and use LINQ to ADO.NET Data Services • Supports full databinding • Updateable • Client Side (Microsoft AJAX) • Need ASP 4.0 JavaScript Preview 3 or better (still beta) • Client side API facilitates client side calls to Astoria from JavaScript • Client side HTML template binding

  17. Demo-Server Side ASP .NET DatabindingChange Interceptors

  18. Programming from Silverlight 2.0 • Full LINQ to Astoria support via a proxy • Must consume all services asynchronously

  19. Demo-Silverlight 2.0 databinding via LINQ to Astoria

  20. Cross Domain Concerns • Need your domain in crossdomain.xml or clientaccesspolicy.xml • If not, build a web service in the same project to consume the Astoria service • Re-expose to Silverlight via WCF • Consume via Linq to XML • Updates need to handled separately

  21. Agenda • What is REST? • What is ADO .NET Data Services (Astoria)? • Consuming ADO .NET Data Services Data • Futures: WCF REST Starter Kit, Astoria Offline

  22. WCF REST Starter Kit • CodePlex download that gives Visual Studio SP1: • New WCF RESTful Templates • Kit expands the http capabilities in WCF • Can build RESTful services • Can consume RESTful services • Including from Ruby, etc

  23. Astoria Offline • Ability to take an Astoria service offline

  24. Questions?

More Related