Posted by: techsavygal | March 10, 2009

Getting Started with REST in WCF

Hi All,

If you are planning to get started with REST in WCF, the following information might be helpful.

What is REST?

Representational state transfer (REST) is a style of software architecture for distributed hypermedia systems such as the World Wide Web. As such, it is not strictly a method for building “web services.” The terms “representational state transfer” and “REST” were introduced in 2000 in the doctoral dissertation of Roy Fielding,[1] one of the principal authors of the Hypertext Transfer Protocol (HTTP) specification.

REST strictly refers to a collection of network architecture principles which outline how resources are defined and addressed. The term is often used in a looser sense to describe any simple interface which transmits domain-specific data over HTTP without an additional messaging layer such as SOAP or session tracking via HTTP cookies. These two meanings can conflict as well as overlap. It is possible to design a software system in accordance with Fielding’s REST architectural style without using HTTP and without interacting with the World Wide Web.[2] It is also possible to design simple XML+HTTP interfaces which do not conform to REST principles, and instead follow a model of remote procedure call. The difference between the uses of the term “REST” therefore causes some confusion in technical discussions.

Systems which follow Fielding’s REST principles are often referred to as “RESTful“.

What are RESTful Web Services?

A RESTFul web service is a simple web service implemented using HTTP and the principles of REST. Such a web service can be thought about as a collection of resources. The definition of such a web service can be thought of as comprising three aspects:

Members of the collection are addressed by ID using URIs of the form <baseURI>/<ID>. The ID can be any unique identifier. For example if a RESTFul web service representing a collection of cars for sale might have the URI f the service uses the car registration number as the ID then a particular car might be present in the collection as

The following table shows how the HTTP verbs are typically used to implement a web service.

RESTful Web Service HTTP methods
Collection URI such as List the members of the collection. For example list all the cars for sale. Not generally used. Meaning defined as replace the entire collection with another entire collection. Create a new entry in the collection where the ID is assigned automatically by the collection. The ID created is typically returned by this operation. Not generally used. Meaning defined as delete the entire collection.
Member URI such as Retrieve the addressed member of the collection Update the addressed member of the collection or create it with a defined ID. Not generally used. Delete the addressed member of the collection.

What are WCF Rest Services?

WCF Rest Services are normal WCF Services that have added functionality so that they can be consumed in a RESTful manner (URI vs URL, Usage of HTTTP Verbs, Usage of Different Data Transfer Formats like JSON, YAML, etc…). So for example, if you had a stock ticker web service that you built in WCF, instead of requiring the caller to use a heavy WSDL implementation and ASMX, you could just use the WCF Rest functionality to publish that service as a JSON service instead and have it consumed via AJAX without having to point to an ASMX resource.

An example of WCF REST Service in .Net Framework 3.5:

WCF 3.5 provides explicit support for RESTful communication using a new binding named WebHttpBinding.
The below code shows how to expose a RESTful service

interface IStock
int GetStock(string StockId);

Microsoft has released a white paper in early 2007 comparing different distributed communication technologies with WCF. (including REST Services).

You can download this whitepaper from here (

Though there are loads of information on REST these days, i found the following links to be very insightful and helpful in understanding this technology.

How-to create a WCF Restful Service Video (

An Introduction to WCF Restful Web Services by Jon Flanders in MSDN Magazine  Jan 2009

A Guide to Designing and Building Restful Web Services using WCF 3.5 by Aaron Skonnard on MSDN in Oct 2008

WCF Blog Series:

Screencast Series on Channel9:

MSDN WebCasts:

REST and WCF 3.5 – Adnan Masood (LEVEL 200)

VS 2008, WCF and REST – (Level 200)

REST and ASP.Net MVC – Brian Hitney (Level 200)

REST and ADO.Net Services – Chad Brookes (Level 200)

REST Developer Center on MSDN

MSDN Code Samples:

REST and POX (

For further queries on troubleshooting and general advice, you can also check out REST Forums from MSDN.




  1. […] the original here: Getting Started with REST in WCF Share and […]

  2. eS0Y70

  3. great article. Please go through REST WCF 4 Service using VS 2010 Article for more info..

  4. Could I order a new chequebook, please? young lesbian mpeg bcxwd

  5. How do I get an outside line? lesbian teens showering %-]

  6. Sorry, I ran out of credit nn teen model

  7. Where do you come from? young first time loli :-O

  8. What do you do? Illegal Preteen Nymphets %-(

  9. What sort of music do you like? Kds Tgp Bbs qnl

  10. Nice to meet you Immagini Il Cassonetto Nn Una Culla

  11. How many more years do you have to go? Greatlolita Bbs

  12. I’m at Liverpool University young pussy bbs I love it when the girl gets to cum and THEN she gets fucked. This is how it should be, the hornier the girl, the better it feels when you fuck her. Yes this woman is very hot.

  13. Your account’s overdrawn teens free nymphets Worst pussy licking I’ve ever seen in my life. And honestly, this dude doesn’t know how to treat a pair of big tits.

  14. Through friends little girls undressed I have always find this guy so sexy, makes me wet so easily, however i prefer him with short hair instead of that nonsense ponytail

  15. How did you make this blog site look this awesome!? Email me if you get the chance and share your wisdom. .

  16. Jesus Christ there is lots of spammy feedback on this website. Have you actually thought about trying to get rid of them or installing a wordpress plugin?

  17. Can you please remove “non-technical” comments?

  18. WOW just what I was looking for. Came here by searching for tits

  19. Hey I know this is off topic bbut I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this
    for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your new

  20. Admiring the commitment you put into your site and detailed
    information you present. It’s good to come across a blog every once in a while that isn’t the same old rehashed information.
    Excellent read! I’ve saved your site and I’m including your
    RSS feeds to my Google account.

  21. Hey there, You have done a great job. I’ll definitely digg it and personally recommend to cfcdeckgkddd

  22. They can provide home elevators services coming
    through the pipeline also.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: