1

I would like to get some feedback from the asp.net community about the current technologies used in creating a new web service.

If i want to get started on exposing a web service that talks to oracle database and returns some results should i be leaning towards WCF web service or ASP.net Web API ? Which one is preferred?

Thanks in advance.

Levi Botelho
  • 24,626
  • 5
  • 61
  • 96
cableload
  • 4,215
  • 5
  • 36
  • 62
  • 1
    possible duplicate of [WCF Service or Web API](http://stackoverflow.com/questions/9502548/wcf-service-or-web-api) – Martin Feb 06 '13 at 15:42

2 Answers2

3

This question has been more or less answered here. I also really recommend that you take a look at this article.

But that being said, to keep it short, you can think of WebAPI as a simpler more lightweight alternative to WCF. WebAPI services operate over HTTP and are best suited to simpler tasks, whereas WCF is more versatile in the protocols that it can communicate with, and communicates using SOAP which in itself is a fairly heavyweight alternative to REST which is often used with WebAPI.

Since you are simply providing what is essentially a data access point, I would recommend that you go with WebAPI.

Community
  • 1
  • 1
Levi Botelho
  • 24,626
  • 5
  • 61
  • 96
1

I assume you are talking about WCF Data Services.

Web API is much younger than WCF DS, and thus is a little less mature. Web API last I checked did not support full filtered queries (a la OData) outside of a pre-release. http://nuget.org/packages/Microsoft.AspNet.WebApi.OData/0.3.0-rc

However its worth noting that Web API does look like its much more configurable.

Aron
  • 15,464
  • 3
  • 31
  • 64
  • Thanks a lot for all of your suggestions. I have one more quick question. Apart from exposing data, i would like to use the same service for performing operations within other ASP.net or windows forms applications or java based..or whatever it can be. I assume that will not be an issue with either of these choices right? – cableload Feb 06 '13 at 15:51
  • You would have to implement the actual operations themselves in Web API. WCF DS just has a default implementation with extension points for CREATE/UPDATE/DELETE and READ respectively known as interceptors. – Aron Feb 06 '13 at 15:53
  • Thanks Aron. this will help. – cableload Feb 06 '13 at 15:56