Building a simple REST service
In the last two recipes, we understood how to call simple REST-based web services using WebClient
classes. In this recipe, let's build a simple REST service and a client to understand how easy and simple the REST architecture is. We will use the WebMatrix to build the web service and stream the result using JSON (Java Script Object Notation) format.
Getting ready
To create the web service we will be using Microsoft's WebMatrix tool, as it is a simple and a free tool for building server-side applications. Install it using the Platform Installer at this location: http://www.asp.net/web-pages.
How to do it...
Let's build a simple MyLinks service using the WebMatrix and MyLinks client using the Phone 7 application to consume the service.
Open the WebMatrix and create a website using a blank template and name it MyLinks site, as shown in the following screenshot:
Click on Databases from the Navigation bar at the bottom to add a local database. The local database has...