Presentation is loading. Please wait.

Presentation is loading. Please wait.

Steve Maine Senior Program Manager Microsoft Corporation.

Similar presentations

Presentation on theme: "Steve Maine Senior Program Manager Microsoft Corporation."— Presentation transcript:

1 Steve Maine Senior Program Manager Microsoft Corporation

2 SourceSource:






8 RESTfullness PuristsPragmatists



11 ServiceHost Language="C#" Debug="true" Service="Caching1.FeedService" Factory=System.ServiceModel.Activation.WebServiceHostFactory %> "%>


13 [OperationContract] [WebGet(UriTemplate=product/{productId}")] Product GetProduct(int productId); Variable





18 Please fill out your evaluation for this session at: This session will be available as a recording at:


20 © 2008 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.


22 [OperationContract] [WebInvoke( Method=PUT", ResponseFormat=WebMessageFormat.Json, UriTemplate=product/{productId}")] Product UpdateProduct(int productId, product p); [OperationContract] [WebGet( ResponseFormat=WebMessageFormat.Json, UriTemplate=product/{productId}")] ProductData GetProduct(int productId);

23 [OperationContract, WebGet] Stream EchoText(string text) { if( text == null ) throw new WebProtocolException( HttpStatusCode.BadRequest );... }

24 [OperationContract, WebGet] Stream EchoText(string text) { return new AdapterStream( textWriter => { textWriter.WriteLine("You said: "); textWriter.WriteLine(text); textWriter.Flush(); }, Encoding.UTF8); }

25 public class XHttpMethodOverrideInterceptor:RequestInterceptor { public override void ProcessRequest( ref RequestContext requestContext) { //Change the HTTP method used for dispatch based on //the X-HTTP-Method-Override header }

26 [OperationContract, WebGet] [WebCache(CacheProfileName="CacheFor1Min")] public Atom10FeedFormatter GetFeed(int i) { … }

27 [OperationContract, WebGet] [PrincipalPermission(SecurityAction.Demand, Role=admin")] SampleResponseBody GetData(int i, string s)

Download ppt "Steve Maine Senior Program Manager Microsoft Corporation."

Similar presentations

Ads by Google