views:

70

answers:

4

I want to write my first REST web service using the .Net framework. I've seen fairly passionate comments from various people about which is best and have even found some differing comments from Microsoft.

My web service should be fairly simple: I want to expose bus timetable information. I figure the resources I will be concerned about are

  • Fares
  • Timetables (routes, stops)

What would be the most appropriate (i.e. not necessarily the easiest, most fun or your personal preference) technology to use out of WCF, ADO.NET Data Services or ASP.Net MVC?

A: 

ASP.NET MVC is for web applications so not that

We currently use WCF at work and I'n not over joyed at it's design although it seems easy to use the web.config file is a pain in the arse and it is to easy to put everything in one huge service.

Haven't used ADO.Net Data Services so can't say.

Honest adivce use a Java solution instead, I only work in the Microsoft ecosystem at work and would avoid a workplace that only used Microsoft if I changed jobs.

Java is much nicer, the language and api is cleaner and there is alot more third party software for enterprise level applications.

ealgestorm
Why the down vote?
ealgestorm
With due respect, this doesn't help me. The question is about which *.Net* framework is best. Not which framework in general. I have no doubt that Java offers some excellent options around web services, but this is not my skill set and I don't have the inclination to work through the intracacies of an entirely different language.
Phil.Wheeler
Then my answer would be WCf is the latest of a bad batch so therefore probably the best.
ealgestorm
Your comment is incorrect. WCF is not the latest of the three technologies.
Franci Penov
well MVC is newer but I was not counting that as a solution to his question it's a web application framework
ealgestorm
WCF Data Services (aka ADO Dat Services, aka Astoria) is also newer than WCF
Franci Penov
+5  A: 

If you want simple, just use generic handlers (.ashx).

If you want complicated, then WCF.

Personally, I've done a couple WCF projects and quite frankly won't willingly do another one. It's a tremendous amount of code just to get the simplest things to work.

Chris Lively
I couldn't agree more. I did one project with WCF and Silverlight, and because a problem with serialization all the bloody proxy classes got messed I lost one week trying to find the problem.... specially because the unfriendly error messages that don't help anything!
vtortola
+1  A: 

You can develop your own as well, creating a http handler that handles all requests, and parsing the urls yourself. It's a little bit more difficult and time consuming, but you get more control. I'm doing one in this way, so I get the URL and I parse the diferent segments and the request stream to know which data should I push to the output stream in XML.

It it's a project you have to deliver and forget, go with WCF REST, but if it's an application for yourself or your own company or simply you want to learn and have fun seeing how everything works under the hood... let aside the happy Microsoft "everything-in-one-frameworks" and do it yourself :D

Cheers.

vtortola
+2  A: 

WCF is the Microsoft messaging bus. It aims to help with development of distributed message driven services.

WCF Data Services is an implementation of the OData protocol on top of WCF that helps with exposing your data through an automatically generated RESTful interface.

ASP.NET MVC is a framework that helps with development of web applications based on the model-view-controller pattern.

You can implement your RESTful service using any of the three technologies, however:

  • Choose WCF if you want full control over the definition of your service interface and payload.
  • Choose WCF Data Services if you need to expose your data over OData with minimum efforts around the actual service implementation.
  • Choose ASP.NET MVC if you want a simple RESTful service that is well integrated within your a web-site and shares and reuses code with it; and you don't mind the overhead of the ASP.NET pipeline.

I would personally suggest you use the WCF Data Services to implement your service, since it seems to be mostly data-driven.

Franci Penov
Thanks. This is a very complete comparison.
Phil.Wheeler