Disclaimer

The Resources Over MVC (ROM) assembly allows your RESTful web service to serve multiple representations. Out of the box it supports JSON and XML. One advantage of creating a web service using ASP.Net MVC rather than Windows Communication Foundation (WCF) is that you also get great support for serving XHTML as another representation. This allows a developer to investigate your web service with their browser. In this post we’ll look at providing help (and a test harness) for the client developer directly within the web service.

The previous Bare Minimum posts showed how to use the Resources Over MVC (ROM) assembly to add some RESTful features to a web site developed using ASP.Net MVC. This post introduces a second sample project that will be used in future posts to demonstrates the other functionality available within ROM.

Recently MVC 3 was released which is a good reason for me to update our RESTful web service framework. This latest version is compiled against ASP.Net MVC 3 and .Net 4. I have also taken the opportunity to introduce some new features that have either been requested or come out of actual implementations.

When ASP.Net MVC 2 came out, it included support for overloading POST requests, something I had previously incorporated into our RESTful framework. The release also came with the latest incarnation of Microsoft’s experimentation with providing a RESTful framework for ASP.Net MVC (this is part of the ASP.NET MVC 2 Futures download). I looked at their first offering in an earlier post when it was known as the “Rest for ASP.Net MVC SDK”. It had some interesting ideas, but wasn’t comprehensive enough for me. So with this new release, I was keen to see if I could retire our framework (or at least parts of it) and use some of the new features. So here I’ll look at each feature I’d like to see in a RESTful web service and see how well it is supported, as well as look at some new ideas altogether.

In this series of posts, I have concentrated upon creating a truly RESTful web service… it has not been a priority to use the full power of ASP.Net MVC’s extensibility. However, this has resulted in a solution that is too intrusive into ASP.Net MVC. The consequences being, any web service developed with the Shoulders of Giants DLL can be difficult to write unit tests for or extend in other directions… so with this and my previous post, I hope to address this.

A little while back I reviewed the Rest for ASP.NET MVC SDK that was released by Microsoft WCF team. I liked some of the ideas it contained so promised to bring some of those into our code. Well, I’ve finally started to do that.

Over the last year I written a whole series of articles looking at creating a RESTful web service. For some time I’ve been meaning to tidy up the DLL that provides the RESTful functionality… and finally I’ve got round to it!