4. The Browser Generic client experience URI’s Addressing and identification HTML Common presentation format Hyperlinks Anarchic interconnectivity HTTP GET Common operation everything supports Content-Driven Web Architecture
6. Capability-Enabled Web Architecture Rich Browser Clients Programmability via script or plugins HTTP Baseline application protocol Common set of operations + status codes Domain-neutral data-oriented formats JSON, Atom/Atom Publishing Refine to support domain-specific schemas Presentation formats HTML, CSS
7. RESTful Tenents The Web is a graph of linked Resources Resources are identified by URI’s Resources support a fixed set of operations In practice, these are defined by HTTP Applications follow links to achieve late binding REST is an architectural style, not a specification
14. WebServiceHost Specialized SerivceHost for RESTful services Eliminates need for lots of configuration Automatically configures address, binding, contract Optimized for single-endpoint services Use from .svc file: <%@ ServiceHost Language="C#" Debug="true" Service="Caching1.FeedService" Factory=“System.ServiceModel.Activation.WebServiceHostFactory” %>"%>
15. [WebGet] And [WebInvoke] Binds a WCF operation to URI space and HTTP method Indicate the HTTP Method for the operation WebGet – Don’t make me write it WebInvoke – All verbs other than GET (Method parameter takes in the name of the Verb) Other Parameters BodyStyle – Indicates whether the Request/ Response are wrapped or not RequestFormat – Json or Xml ResponseFormat – Json or Xml UriTemplate – Rich binding to URI
16. UriTemplate String that allows you to define the structure of the URI, as well as to define “Holes” The “Holes” are variables You Bind the template with parameters to fill the holes {productId} hole / variable gets bound to productId parameter in operation Variable [OperationContract] [WebGet(UriTemplate=“product/{productId}")] ProductGetProduct(intproductId);
17. WCF REST Starter Kit Microsoft.ServiceModel.Web.dll New features supporting RESTful services Visual Studio 2008 Templates REST Collections/Singleton Services Atom Feed/Atom Publishing Protocol HTTP/POX Services REST Samples Codeplex Project Released at PDC Written by WCF team Features may be included in .NET 4.0
18. What We've Talked About Today REST and the “zen” of the web WCF features for REST scenarios [WebGet] + [WebInvoke] UriTemplate WebHttpBinding And many more… The WCF REST Starter Kit Available today at http://msdn.com/wcf/rest