views:

1427

answers:

7
+4  Q: 

REST on IIS

I'm wondering how many folks using the Microsoft development stack (IIS and/or ASP.NET) are actually using REST? If so, what forms of rest are being used?

REST can be categorized a zillion ways, but for the purpose of this question I'll categorize it as follows:

  1. Radically REST: Using all the HTTP methods PUT/POST/GET/DELETE
  2. Moderate REST: Using GET/POST
  3. REST Hybrid: Uses just the GET or POST HTTP method, but follows RESTful principles of addressability and state.

In a class I'm teaching we've been trying to implement a "radically RESTful" service on IIS, but we've been having difficulty implementing the PUT method. There doesn't seem to be a lot of buzz on implementing PUT on IIS so I'm wondering how many people are actually using full blown REST? Are you using REST?

+1  A: 

What version of IIS? In IIS6 you need to enable WebDAV to enable PUSH requests to get through (no, I don't think that makes much sense either :-)). I don't think that's the case in IIS7 though.

Steven Robbins
IIS 7 on 2008 servers
Jeff
by default IIS 7 refuses PUT requests.
Jeff
+1  A: 

There is a great blog article on all those methods in the context of REST here:

http://reinout.vanrees.org/research/phd/various-stuff/getputpostdelete

Sohnee
+2  A: 

I'm pretty sure the Microsoft ADO.NET Data Services uses RESTful services. It might be worth checking out... aside from being restful, it's a really cool tech.

Here's an extract from a white paper on it:

The goal of Microsoft® ADO.NET Data Services is to enable applications to expose data as a data service that can be consumed by web clients within corporate networks and across the internet. A data service is reachable via regular HTTP requests, using standard HTTP verbs such as GET, POST, PUT and DELETE to perform CRUD operations against the service. The payload format used by the service is controllable by the application, but all options are simple, open formats such as JSON and Atom/APP.

Here's a white paper and it's home page (at least what I think is it's home page)

HTHs, Charles

Charlino
+3  A: 

It depends how you approach it.

By default IIS will limit verbs to ASP.NET pages to GET, HEAD, POST and DEBUG. You are, of course, free to tell it to accept PUT as well by editing the handler mapping. Assuming you wanted your own extension you'd do something like

<httpHandlers>
    <add path="*.example" type="System.Web.UI.PageHandlerFactory" verb="GET, HEAD, POST, PUT, DELETE, DEBUG"/>
</httpHandlers>

If you want to remap .aspx you, of course, can in much the same way, assuming the server is configured to allow you/

blowdart
+1  A: 

I'm using the .Net class, HttpListener, which is the IIS web server engine(http.sys) without the IIS admin tools. I am handling all of the HTTP verbs. You can add attach the ASP.Net runtime to this if you like, but you don't need to.

In fact in a few cases we implemented a version of PATCH as an experiment. Once you get down to the basics, the verb is simply a string in one of the HTTP headers.

You actually cannot categorize REST in a zillion ways. There are may ways of using HTTP to build distributed applications but there is only one definition of REST.

Darrel Miller
+2  A: 

I think part of the reason for the lack of buzz around REST on the IIS stack has been Microsoft's original adoption of SOAP as the way, truth and light when it came to web services - especially with Windows Communication Foundation being heavily SOAP focused.

They have recently released the WCF REST Starter Kit, to follow on from the release of .NET 3.5, and also the ADO.NET data services that are part of .NET 3.5 SP1.

Zhaph - Ben Duguid
+9  A: 

I'm involved in a project that uses WCF REST on IIS, but of course I'd recommend having a look at the framework I built: OpenRasta is a .net open-source stack that makes implementing REST much easier.

Google is your friend. The main site is http://trac.caffeine-it.com/openrasta.

serialseb