.NET REST – Choosing the Right .NET REST Approach or Technology

netrestwcf

I am implementing a RESTful web service and several client applications that are mostly in Silverlight. I am finding a litany of options for developing both the server-side and client-side of the API but am not sure which is the best approach. I'm concerned about stability as well as a platform that will continue to exist a few months from now.

We started using the REST Starter Kit with .NET 3.5 but moved to the new WCF Web API when updating to .NET 4.0. All of their documentation indicates that WCF Web API is the replacement for the RSK. However, Web API is only in Preview 4 and does not include support for Silverlight or Windows Phone 7 clients (yet).

WCF Web API looks like a wrapper on top of the WCF WebHttp Services stuff provided in the System.ServiceModel.Web library which makes me think that maybe it would be simpler to just go with the built-in stuff but Web API does offer some nice features.

I am specifically tied-up trying to determine the best course for the client-side. My main requirement is that I need to support deserializing into my client-side objects quickly and easily. The Web API offers a nice client library but doesn't have a Silverlight version.

I'd like to use the latest approach and the toolset that is being actively developed and supported.

  1. Is the REST Starter Kit really obsolete?

  2. Has anyone had any success implementing the WCF Web API toolkit?

  3. Is there merit to using either of these over the built-in WCF WebHttp Services features found in System.ServiceModel.Web?

  4. Is there a single solution that works for any client (web, Silverlight, etc.)?

What suggestions do you have?

Best Answer

Just to follow-up and close out the post, with Preview 5, the WCF Web API took a huge leap forward making it incredibly simple to create REST APIs. And while the current codebase on Codeplex does not include a Silverlight client, there is a toolkit out there and I was able to easily strip out the Async-CTP parts from the open source code and create a SL version.

I strongly recommend anyone interested in getting into REST with WCF look into the framework: http://wcf.codeplex.com.

FYI - It will be an integrated part of .NET 4.5 and is currently being rewritten to run on the same core framework as ASP.NET MVC (although I am told it will definitely support self-hosting still).