Posted on

Recently Microsoft added REST support to WCF services.  So what RESTful service means?

From WIKI:

“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:

  • The URI for the web service such as http://example.com/resources/cars
  • The YAML but can be anything.
  • The set of operations supported by the web service using HTTP methods including but not limited to POST, GET, PUT and DELETE.

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 http://example.com/resources/cars. If the service uses the car registration number as the ID then a particular car might be present in the collection as

<%@ ServiceHost Language="C#" Debug="true" Service="FetchChildItems" CodeBehind="~/App_Code/FetchChildItems.cs" %>