views:

488

answers:

5

Hi,

as per wikipedia terms REST is

REST can be considered the architectural style for the World Wide Web. The architectural style was developed in parallel to the HTTP/1.1 protocol, based on the existing design of HTTP/1.0

REST practices started long time ago along with HTTP evolution. If i understand the defenetions correctly , we can take advantage of existing techologies and can built REST services on top of it.

My requirement is to built RESTFul services on top of .Net 2.0 (i know this can be easily acheivable in WCF, but currently i dont have that luxury).

  • is this possible??

  • if possible please point me some working examples..

  • is there any blogs or writings in internet covers the implementation of this approach..?

EDIT:

i forgot to mention this one.

  • is it possible to consume the REST services from javascript.??

Thanks in Advance

Cheers

Ramesh Vel

+1  A: 

There is a book restful .net

Try this for a client: http://developer.yahoo.com/dotnet/howto-rest_cs.html for example

edit: to reflect comment:

I found this article on how to do a restful serivce with http handlers.

And how to consume via javascript.

Preet Sangha
thanks for the links preet.. the yahoo link you have given talks abt how to consume the rest services through c#.. But i also wanted to know the REST implemenation in .Net 2.0.. thats my main concern..
Ramesh Vel
@ramesh - haved added another link
Preet Sangha
thanks again... both are helpful
Ramesh Vel
+1  A: 

Apart from rolling your own Http modules there are 3 main toolkits I know of for implementing REST services.

  • WCF - Has the advantage that it comes with the framework and has the underlying framework to support more advanced scenerios. Microsoft also provide the WCF Starter Toolkit which has a lot of extra goodies.
  • OpenRasta - Available here. A much simpiler option than the WCF route. I haven't use it enough to comment on advanced usage scenerios.
  • ASP.NET MVC - Although not a REST framework can still be used to implement REST services. Phil Haack has a good blog post here.
Nic Strong
WCF and ASP.NET MVC aren't available on .NET 2.0. OpenRasta is, though.
Andy Johnson
thanks for the info Nic.. My main concern is REST implementation in .Net 2.0.. i have specifically mentioned in my question.. :(
Ramesh Vel
Sorry, should have read it more carefully. I guess that only leaves OpenRasta from the list of toolkits I listed.
Nic Strong
+1  A: 

You can get it working by writing custom handlers.

Take a look at this article.

http://www.codeproject.com/KB/webservices/REST%5FWeb%5FService.aspx

I believe your best bet to consume REST services in javascript is to get the results in json format.

From javascript you make a request to the service by specifying the format as json and on the server side you check for the format and serialize the response data to json format.

A: 

If you go for OpenRasta, don't hesitate to contact me if you encounter any bugs in the 2.0 support.

Seb

serialseb
sure,will do that mate...
Ramesh Vel
+1  A: 

I built my own REST framework on top of HttpListener and run it in an Windows Service. It is pretty easy to get the basic stuff going. However, over time you will need plenty of other infrastructure code to support dealing with all aspects of HTTP. If you are starting from scratch, then check out OpenRasta. It will guide you down the right path and save you a whole lot of time.

Darrel Miller
thanks Darrel for your comments... i just started playing with REST internals extending HTTPhandlers.. surely i will look into the openRasta..
Ramesh Vel