WCF makes it very easy to expose JSON data over a RESTful interface, as long as you are aware of a couple of “gotchas” in advance.

This article will explain those to you, so you can focus on your business logic rather than configuration of your WCF services.

We start this example by creating a WCF Service Library project:

Next we need to add a reference to the System.ServiceModel.Web framework. Right click on your project file and select Add Reference…

As this framework is not part of the .Net Framework 4 Client Profile, Visual Studio kindly informs us that it will update our target Framework to the full version of .Net Framework 4. Click Yes to accept this change:

The key elements here are the attributes applied to the method. We are enabling the method to be called over HTTP GET, returning the data in Json format and setting the Uri template to ensure we are using a RESTful interface.

To test your brand new service we will pass in the id value of 10 simply by opening your favourite browser and pasting in the following URL:

Yes the Base from where you are starting is good you want like to explain how to implement a Json service.
But nobody can use your information really without more explanation about how to get the project work.

As previous messages said, I too could not get this example to work outside the VS2010 WCF service debugger. After wasting a day attempting to get things working, I deleted this project and created a new service using the online templates for a WCF REST service, and following this blog post: