views:

37

answers:

3

I would appreciate if someone can provide some insight into which one is more beneficial.

RESTful service in WCF can provide the same functionaly as ASP.Net MVC Controller, i.e URLS can be formed appropriately using Controller/Action.

Is there real benefit of using one over the other.

WCF Rest service will provide.. 1) Cert Authentication out of the box 2) Logging 3) Message Headers etc

MVC 1) Different Action Results out of the box

If someone has used or debated these two technologies . please let me know

UPDATE:

I went ahead with the MVC Model as it gives me lot of flexibility and I can use the same action to render different views with CustomActionInvoker, which is really cool!!!

-RN

A: 

WCF makes your service more manageable and offers more protocol options like TCP, Named Pipes, PerChannel, and MSMQ.

Nazaf
I am not sure if you can use Tcpbinding with WCF. Rest specifically uses webhttpbinding. I might be wrong though
Ben
@Ben No you are not wrong.
Darrel Miller
You must be wrong. You can use netTcpBinding with WCF. See this http://msdn.microsoft.com/en-us/library/ff647180.aspx#Step4
Nazaf
@Nazaf .. I was specifically talking about WCF REST services.
Ben
A: 

WCF gives you the ability to specify multiple methods of binding to the service through the web.config including restful urls, giving you greater flexibility. In conrast, mvc provides you with the ability to easily construct resful urls and output data via code in much the same way as you do a web application, which is really easy and requires minimal additional knowledge if you already know mvc.

My recommendation would be to go with wcf if the service is really important to the overall solution, likely to be called in a different or many ways or has or is likely to have special security requirements.

On the other hand I would go mvc if this is meant to be a quick and simple isolated solution or perhaps is just providing a different representation of data being output in an existing .net mvc application.

Dean Johnston
A: 

At this point in time, your best option is ASP.NET MVC. It provides cleaner access to the HTTP primitives you need to be able to design RESTful solutions.

The only significant advantages of WCF Rest is the ability to self-host the service and if you want to use ADO.NET Data Services to deliver OData/Atom services, then obviously WCF is your best choice.

Darrel Miller