none
REST architecture in .NET?

    Question

  • Is it possible to do REST in .NET?  If so, how come it's so difficult to find any resources on it.  I have yet to find a tutorial or walkthrough on .NET and REST. 
    Wednesday, July 25, 2007 10:53 PM

Answers

  • It is possible but not easy to do RESTful development in .NET today
    It would be much easier to do that with the next verison -
    Take a look at the following presentation from Mix 07 by Don Box and Steve Maine

    Arnon
    Thursday, July 26, 2007 7:44 PM
  • The best example of REST style architecture is classic Web with static HTMLs linked to each other.

     

    REST believes in fast and simple, so it should be used to build web services which are more oriented towards simple CRUD style of transactions but no or very less security requirements.

     

    SOAP gives the power of tightly coupled systems to loosely coupled systems and is recommended for building complex, secure and robust network-based systems.

    A very recent implementation of RESTful web services is 'Astoria' data services framework released by ADO.NET team at Microsoft.

     

    You can read more @ http://dotnetwithme.blogspot.com/2007/06/rest-vs-rest.html

    Friday, July 27, 2007 8:07 AM

All replies

  • Yes it possible to do RESTful systems .Net after it is only an architectural paradigm and nothing more, reasons as to why you won't find any .Net examples is because IMO the general trend in .Net applications is to create more SOAP based communication systems i.e. web services. Before the current fashion for SOA, web service etc people were creating RESTful systems without realising, in fact as far as I am aware the term 'REST' was coined at the start of decade.

     

    An example of .Net RESTful systems would be using the System.Web namespace and the HttpRequest class to along with the HTTP PUT, GET, POST, DELETE methods to perform business operations exposed via a HTTP url. Now there are plenty of examples on how to do this in .net but they probably won't have the 'REST' world associated to them. Another example would be the use of the webDAV technology.

     

    Personally I prefer the use of SOAP + web services for communication over the web in these kind of scenarios - I believe it gives greater clarity to a design and helps improve the implementation by allowing the use of design patterns and practices for the web service contract, methods and messages.

     

    Just my two penny's worth...

     

    HTH

     

    Ollie Riches

     

    Thursday, July 26, 2007 8:43 AM
  • It is possible but not easy to do RESTful development in .NET today
    It would be much easier to do that with the next verison -
    Take a look at the following presentation from Mix 07 by Don Box and Steve Maine

    Arnon
    Thursday, July 26, 2007 7:44 PM
  • So, my question to both of you is that when should we use Restful architecture and when should we use SOAP webservices.

     

    Please put in some scenarios and judging factors for aspiring architects like me.

     

     

    Friday, July 27, 2007 5:54 AM
  • The best example of REST style architecture is classic Web with static HTMLs linked to each other.

     

    REST believes in fast and simple, so it should be used to build web services which are more oriented towards simple CRUD style of transactions but no or very less security requirements.

     

    SOAP gives the power of tightly coupled systems to loosely coupled systems and is recommended for building complex, secure and robust network-based systems.

    A very recent implementation of RESTful web services is 'Astoria' data services framework released by ADO.NET team at Microsoft.

     

    You can read more @ http://dotnetwithme.blogspot.com/2007/06/rest-vs-rest.html

    Friday, July 27, 2007 8:07 AM
  • I found this quote on MS website this morning and it gives a very good and real example of when the use of REST over a SOAP based web service is ideal.

     

    'The goal of Microsoft Codename Astoria is to enable applications to expose data as a data service that can be consumed by web clients within a corporate network and across the internet. The data service is reachable over regular HTTP requests, and standard HTTP verbs such as GET, POST, PUT and DELETE are used to perform operations against the service. The payload format for the service is controllable by the application, but all options are simple, open formats such as plain XML and JSON. Web-friendly technologies make Astoria an ideal data back-end for AJAX-style applications, and other applications that need to operate against data that is across the web.'

     

    http://msdn2.microsoft.com/en-us/data/bb419139.aspx

     

    HTH

     

    Ollie Riches

    Friday, July 27, 2007 8:29 AM
  •  

    So, it means that we can use REST with webservices(using non SOAP).

    Great, can you give me some link from where i can download such a project so that i can get more insight about.

    Also my main query is what drives us to arrive at whether we need restful or soa based architecture(or it shoulb be soap based messaging).

     

     

    Cheers

    Friday, July 27, 2007 12:22 PM
  • Link for 'Astoria'

    http://astoria.mslivelabs.com/

     

    Friday, July 27, 2007 12:38 PM
  • As for what drives the use of REST over SOAP or vice versa I think is answers by VikasGoyal post:

     

    'SOAP gives the power of tightly coupled systems to loosely coupled systems and is recommended for building complex, secure and robust network-based systems.'

     

    If you are building a relatively simple stand alone solution that will never be used by any other process then a RESTful system is probably a good bet, but if you need to a generic system used by multiple other systems that require security, availability etc then SOAP based services are more appropriate - basically what VikasGoyal said.

     

     

    HTH

     

    Ollie Riches

    Friday, July 27, 2007 1:17 PM
  • Friday, July 27, 2007 2:30 PM
  • Heh, yet another buzzword...

     

    Excellent series of articles on building REST with WCF runtime. Link to the first article - http://staff.newtelligence.net/clemensv/PermaLink,guid,2d61b97b-3a6e-46bd-89db-b1b20499ba18.aspx. Other seven articles are accessible from first one.

     

    IMHO REST can be good candidate for Master Data Services, they are good for CRUD operations, however most of the services are invokable. They expose number of commands. And for such services SOAP are much better then REST.

    Friday, July 27, 2007 6:31 PM
  •  VikasGoyal wrote:

    The best example of REST style architecture is classic Web with static HTMLs linked to each other.

     

    REST believes in fast and simple, so it should be used to build web services which are more oriented towards simple CRUD style of transactions but no or very less security requirements.

     


    You should diffrentiate the technology from the architectural concept
    you can use the simple web-services approach but that doesn't make your services RESTful and (at least in my opinion - though I think some RESTefarians would not agree) you can create RESTful services on top of SOAP (or other technologies)

    the REST concept is not about CRUD it is about thinking in resources and explicit state machines instead of objects and methods.  for exmaple if you have a customers resources and you want to chage a customer's status to VIP we can do something like:

    PUT /customers/1/VIP{... "level": [Gold], "effective": [Wed, 01 Aug 2007 07:39:37 GMT]...}
    in this little sample
    1. we don't "call" on the customer/1 resource with a ?SetVIPstatus=gold we've added a new resource which marks this satatus
    2. if the VIP resource did not exist the PUT would actually create it (i.e. not update it) and you would get a 201 (created) response

    Again, architecture and technology are two different (but related) things but even if you do equate REST with plain web-services it doesn't mean you completely forgo things like secturity (e.g. there's SSL, XML encryption (W3C standard) etc.)

    Arnon
    Wednesday, August 01, 2007 7:50 AM
  • I found this useful blog entry with a lot REST resources listed:

     

    http://tssblog.techtarget.com/index.php/interoperability/mini-guide-rest-representational-state-transfer/

     

    HTH

     

    Ollie Riches

    Monday, August 13, 2007 10:35 AM
  • I've become hugely intrigued by the relative simplicity of REST services myself.  Astoria was what first introduced me to the concept and I have since read the OReilly book about RESTful services.  What I don't like about Astoria is that they are architecting their solution only for their new entity framework.  Once again, Microsoft plays very well with Microsoft but if you have existing infrastructure, it's tough to jump onto the new bandwagon.

    I'm developing MeanFiddler over on sourceforge (http://meanfiddler.sourceforge.net) and I encourage anyone who is interested to help out and drive the open source project into a mature framework.  I'd love to make almost every aspect of it extendible.  If you want a custom entity model, plug in a provider.  If you want a custom uri naming convention, plug in a provider, if you want a custom representation, plug in a provider... 

    REST does not have to be simple CRUD operations either.  At the core, REST is simply a representation of a resource transmitted using straightforward HTTP principles.  If your server has complex querying algorithms or complex post-save processing, REST should not be an interference. 

    I don't think REST will overtake SOAP RPC services simply due to ease of development, but if you are kean on having an extendible, clean architecture I highly encourage everyone to read more about the concepts of REST.
    Tuesday, August 14, 2007 7:25 PM