Navigating the Programmable Web


Published on

RSS. ATOM. JSON. POX. REST. WS-*. What are all these terms, and how do they impact the daily life of a developer trying to navigate today's programmable Web? Join us as we explore how to consume and create Web services using a variety of different formats and protocols. Using popular services (Flickr, GData, and Amazon S3) as case studies, we look at what it takes to program against these services using the Microsoft platform today and how that will change in the future.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Navigating the Programmable Web

  1. 1. Don Box and Steve Maine URI Jockeys Microsoft Corporation
  2. 2. Goals How do my programs use the web? How do my programs become part of the web? How do I do this efficiently and pragmatically? Bits Stuff that's already shipped (lots) Stuff that will ship in Orcas (lots more) Stuff that will ship in TBD (a couple of things)
  3. 3. GET is More It’s the URI, Stupid Important Than Formats Matter You Think
  4. 4. The web pivots on URIs Easy to write down, share, and compare Hierarchy matches many information models Can be treated as opaque identifier (a la a GUID) Can be treated as a structured expression (a la S-Expr) URI-space for a given service often infinite May also be state/data dependent Commonplace to use template syntax to specify quot;holesquot; in URI space (a la A9 and Joe Gregorio)
  5. 5. System.UriTemplate (quot;Orcasquot;) provides runtime support for URI template syntax UriTemplate.Bind fills in template holes with actual values UriTemplate.Match extracts actuals from concrete URI UriTemplateTable provides matching over multiple candidate templates Most specific match wins
  6. 6. Uri baseAddress = new Uri( “http://localhost:81” ); string artist = quot;Led Zeppelinquot;; string album = quot;Fourquot;; UriTemplate template = new UriTemplate(“music/{artist}/{album}?format={format}quot; ); Uri boundUri = template.BindByPosition( baseAddress, artist, album, quot;rssquot; ); //boundUri: // http://localhost:81/music/Led%20Zeppelin/Four?format=rss UriTemplateMatch match = template.Match( baseAddress, boundUri ); Debug.Assert( match.BoundVariables[“artist”] == artist ); Debug.Assert( match.BoundVariables[“album”] == album ); Debug.Assert( match.BoundVariables[“format”] == “rss” );
  7. 7. Watch Steve Code…
  8. 8. GET CHAOS
  10. 10. Degree of Resultant Apocalypse Dogs/cats sleeping together; mass hysteria The Simpsons Movie Lindsay Lohan Rectal Itching The Oprah Channel Smooth Jazz Turn off Turn off PUT Turn off POST Turn off GET DELETE
  11. 11. [WebGet] (quot;orcasquot;) adds GET support to WCF service operations Allows target URI space to be specified as URI template Templates parameters mapped to method parameters WebOperationContext provides easy access to web specifics (e.g., headers, status codes) [WebInvoke] provides same for other HTTP methods POST is default method
  12. 12. [WebGet]/[WebInvoke] work great for quot;transparentquot; URI with well-understood structure Ideal for server, OK (at best) for client WebHttpClient (quot;experimentalquot;) is a more flexible client- side programming model Supports both transparent and opaque URI Easier to use and more scalable than current WebClient API
  13. 13. Watch Steve Code…
  14. 14. Uniform operations are half the web quot;reachquot; proposition Uniform formats for HTTP entity bodies are the other half HTML was the ubiquitous format for projecting UX Alas, multiple format(s) for exchanging data Original vision for quot;web dataquot; based on plain old XML (POX) JSON offers simpler format/data model RSS/ATOM constrain POX by adding list structure SOAP constraints POX by adding header processing model
  15. 15. WebGet/WebInvoke supports XML, JSON, or opaque binary formats for request/response data SOAP and POX were in the box in V1  SyndicationFeed/SyndicationItem provide rich programming model for dealing with RSS/ATOM data Usable standalone or as WCF message content Integrates with serialization stacks for feed/item extensibility
  16. 16. Watch Steve Code…
  17. 17. Ships in “Orcas” Already Shipped Speculative Bits System.Uri UriTemplate WebHttpClient WebClient [WebGet] WPF SyndicationFeed WCF LINQ for XML JSON Formatter
  18. 18. It’s the URI, Stupid GET is More Formats Matter Important Than You Think SyndicationFeed LINQ for XML UriTemplate JSON Formatter [WebGet]
  19. 19. © 2007 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.