Resources Over MVC – Introduction

October 31, 2011 20:51 by admin

Over the last couple of years I have been blogging about using writing a RESTful web service using ASP.Net MVC. I’ve decided to put this code onto CodePlex and publish it via NuGet. Over the next few days I’ll publish a number of posts in which I’ll take you through creating a basic web service using the Resources Over MVC (ROM) assembly.

I don’t want to prescriptive about what constitutes a RESTful web service, there are plenty of opinions out on the web regarding that matter. In fact I deliberately did not call the assembly Rest Over MVC to avoid the assumption that using this assembly would magically mean your web service was RESTful. For that you will need to do some reading around, design your resources and decide what you think constitutes a RESTful web service. Hopefully, over next few posts, I’ll show that the set of helper classes in this assembly are not too opinionated, but you should be able to use them to provide the following features:

  • Serve and receive multiple representations and encodings of resources
  • Support a constrained number of methods
  • Allow representations to include hyper links

Obviously as this approach is based on ASP.Net, it is providing a web service over the HTTP protocol, so it does make use of standard:

  • HTTP headers
  • HTTP methods
  • HTTP status codes

These are the posts that will lead you through how to implement your own web service:

  • Bare Minimum Part 1 – shows how you can reference the ROM assembly and with a single line of code be returning multiple representations to your clients
  • Bare Minimum Part 2 – adds another line of code to allow your web service receive multiple representations
  • A More Complex Sample – introduces a fuller web service example
  • Simple Clients Part 1 – shows how ROM can return different formats using a query string parameter
  • Simple Clients Part 2 – shows how ROM supports POST overloading via a custom header, form variable or by using a query string parameter
  • Providing Help – allowing client developers to get help from and to experiment with the web service directly in their browser.
  • Allowed Verbs – adding support for the Allow header
  • RESTful Routing – adds support for less capable clients
  • Add a Test Harness – allows your client developers to try out the web service from their browser
  • Custom Serialisation – different ways of getting your representations just right

Comments

October 31. 2011 21:00

trackback

Resources Over MVC - Bare Minimum Part 1

Resources Over MVC - Bare Minimum Part 1

Shoulders of Giants

March 7. 2012 20:24

Sunny

Hi Piers,

I have been reading your blog a long time now & although I am not a regular commentor - wanted to let you thank you for the excellent technical articles. I just cannot say how many times I have referred to your articles, especially regarding ReST to help clarify my thoughts. Once again - excellent work!

Sunny

July 1. 2012 16:38

pingback

Pingback from iitime.com

艾艾时代 » .NET 4.5提升了Web开发的生产率

iitime.com

July 1. 2012 18:33

pingback

Pingback from ostaste.com

.NET 4.5提升了Web开发的生产率 | 橙味网

ostaste.com

Add comment (if you are spamming, at least look my adverts as well!!!)


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading