One of the more interesting (challenging?) things we did with the WCF REST Starter Kit is the REST Collection Service Template. The idea behind this template was to produce a service that allows you read/write access to a service using a simple REST style interface. The idea is to provide both a contract and base class that takes care of most of the REST-“isms” and you simply override the methods to support your business logic.
And how does this template help?
- Provides the URI templates for your service based on a very simple model of a resource per service with an ID parameter
- Supports content negotiation with a query string parameter i.e. “?format=json”
- Supports HTTP status codes such as 201 – “Created” when you add a new item or 404 – Not Found when you try to update or delete an item that does not exist
- Supports append to the collection via POST
What do you think?
One of the reasons we are putting this out to the community in a Codeplex release is that we want to get your constructive feedback. Here is a good starting point. Answer this question
What is wrong with this template?
I’m not tying to sound defensive, I just want to know what you really think.
We know that it isn’t perfect, but if you don’t like it, what do you not like about it? How can we improve it?
The best way to answer these questions is to give it a test drive by running through Lab 3 from the WCF REST Starter Kit Hands On Labs so download and give it a go. You can help us make it better.