I put together a WCF REST over HTTP service and learned a few things along the way.
The best way to learn about WCF REST is to examine the sample project supplied by Microsoft. This is available at Windows Communication Foundation (WCF) and Windows CardSpace Samples. Once you unzip the download you'll find C# and VB sample projects at TechnologySamples\Scenario\PoxMessaging. These simple projects demonstrate everything you need to know.
Creating Your Own Project
The Visual Studio project template for creating a service hosted by IIS isn't grouped with the WCF projects but is with the ASP.NET projects:
Once you have a project created, just follow the pattern in the sample and you'll quickly be ready to test.
Testing Your Project
The easiest way to test your project is to use Fiddler 2. Fiddler 2 includes a tab that lets you form and send HTTP requests:
Just select your verb (GET, PUT, etc.), enter the service URL, enter your HTTP headers, paste your XML into Request Body, and press Execute! Content-Type should be text/xml; Fiddler 2 will automatically calculate the Content-Length header for you. The result will appear in the left pane; you can double click on the line and get a detailed look at the request and response using the Session Inspector.
HTTP Status Code 415 Unsupported Media Type
If you've been following along exactly, your service should be returning a HTTP Status Code 415 Unsupported Media Type. This is because when the project was created in Visual Studio there was an assumption that SOAP would be used. Switching to REST means changing the binding in the web.config file:
<service name="MyService.Service" behaviorConfiguration="MyService.Service1Behavior">
<!-- Service Endpoints -->
<!-- use webHttpBinding for REST instead of wsHttpBinding -->
<endpoint address="" binding="webHttpBinding" contract="MyService.IService">
Note that this page, which is supposed to list all the System-Provided bindings, doesn't mention webHttpBinding.