Tuesday, December 1, 2009

Kick Start to REST Full .NET WCF Service

Recently I was doing some investigation about how to create a Restful .Net WCF service. I had encountered some interesting hiccups in between during the course of action, so I just thought of to share with you all.

Steps to create the Restful WCF service
  1. Create the WCF project by using VS template

  2. Add the namespace System.Servicemodel.web to the project

  3. Decorate the default service with the REST attribute to convert it into a Restful service(WebInvoke,WebGet ,URI definition to access the respective operations etc)

  4. At the configuration side of the service change the binding of an endpoint to webHttpBinding

  5. Describe the REST endpoint behavior as shown below

  6. Link the service endpoint behavior to REST endpoint description by the attribute 'bindingConfiguration' here in this case value is - 'webHttp'

  7. Finally the entry of endpoint should similar to this

Thats all is needed to have a basic REST Service.

I hope this will help you all to have a gook kick start for the REST WCF Service.


No comments: