Welcome to MSDN Blogs Sign in | Join | Help

REST in WCF - Part I (REST Overview)

I will be doing an interactive theatre session at TechEd in a few days (if you are going to be there, stop by - info below).  The topic of the session is REST in WCF.  I thought it might be nice to blog about the topic, as I review my demos, so here goes:

image

I have given this talk a number of times in the past and usually start with a brief overview of REST.  I'll do the same here, but before I begin (and you start drafting your response), I want to bring up the fact that EVERYONE seems to have a different definition of REST.  Some of these definitions are more stringent, while others are more liberal.  I tend to envision a continuum of RESTiness (as GW would put it).  See below...

image

Some basic thoughts behind REST are as follows:

  • Simpler is better
  • The web has been highly successful
  • The web is quite simple
  • The web follows a few guiding principles, and those principles have remained stable over time
  • Web Services should follow "the way of the web"

In keeping with the idea that differing people have differing definitions of REST, there are certainly some characteristics that influence whether a service is RESTful at all, and if it cound be considered RESTful, where it may fall on this continuum.  Here are some (not all) of those characteristics:

  • The use of appropriate HTTP verbs (GET, PUT, POST, DELETE being the major verbs) -  Definitions falling on the HI-REST side tend to be more stringent about which verb is used for particular scenarios.  For example a HI-REST implementation may use GET for fetches, DELETE for deletes, PUT for inserts and updates and POST for appends, while a LO-REST solution may use an overloaded POST for inserts, updates, deletes and appends.
  • The choice of a viable Representation Format - HI-REST solutions tend to lean toward standard representation formats, whereas some LO-REST solutions may see POX as ok.
  • The use of well constructed URIs - HI REST solutions tend toward very descriptive URIs and generally dissuade the use of query strings, whereas some LO REST solutions see the use of QueryStrings as ok.
  • (There are others: the inclusion of links to related info in the payload, the use of appropriate http response codes to name two)

The reason I don't take a definitive stand on what the "Definition of REST" should be is not that I don't care.  The reason is that, from the perspective of WCF, the specific definition does not matter.  WCF supports REST on both ends of the continuum.  In fact, in tomorrows post, I'll build a LO-REST implementation, while in subsequent posts, I will illustrate solutions further toward the HI REST side of the continuum.

If none of this is making much sense yet, that is ok.  The subsequent posts will provide concrete examples (including code). 

Until tomorrow...

Published Wednesday, May 28, 2008 9:44 PM by rob.bagby
Filed under: ,

Comments

# Welcome to the EndPoint!

Welcome to the Connected .NET blog, where we’ll focus on the stuff in the .NET Framework that connects

Tuesday, July 01, 2008 10:09 AM by Connected .NET

# REST in WCF Blog Series Index

As some of you know, I am in the midst of a blog series on REST in WCF. Further, I have been hard at

Tuesday, August 19, 2008 3:26 PM by Demystifying The Code

# REST in WCF Series

Rob Bagby is in the midst of a blog series on REST in WCF and been building a series of screencasts on

Friday, September 19, 2008 11:53 AM by Joe On ASP.NET

# REST in WCF Series

Rob Bagby is in the midst of a blog series on REST in WCF and been building a series of screencasts on

Friday, September 19, 2008 11:54 AM by Joe Stagner - Frustrated by Design !

# REST in WCF Series

Rob Bagby is in the midst of a blog series on REST in WCF and been building a series of screencasts on

Friday, September 19, 2008 12:22 PM by Readed By Wrocław NUG members

# REST in WCF - Part XI (Tunneling PUT through POST)

A common scenario you may encounter when designing your RESTful services is supporting clients that only

Monday, November 10, 2008 12:18 PM by Demystifying The Code

# REST in WCF

The series blog post on REST in WCF REST in WCF - Part I (REST Overview) REST in WCF - Part II (AJAX

Tuesday, December 23, 2008 9:28 AM by Journal of Abu Sayed Mohammad Ismail

# WCF中的REST架构一(REST 概述)

注:从今天开始,我们将陆续翻译Rob Bagby的精彩文章"REST in WCF" 系列,原文链接如下: http://blogs.msdn.com/bags/archive/2008/05/28/rest-in-wcf-part-i-rest-overview.aspx

Monday, January 12, 2009 3:20 AM by WCF Tools中国研发团队的博客

# re: REST in WCF - Part I (REST Overview)

Rob Bagby is in the midst of a blog series on REST in WCF

Tuesday, May 26, 2009 2:07 PM by azcodemonkey
Anonymous comments are disabled
 
Page view tracker