WCF Data Services (OData) Vs ASP.NET Web API

后端 未结 8 626
鱼传尺愫
鱼传尺愫 2021-01-29 21:01

I am designing a distributed application that will consist of RESTful services and a variety of clients (Silverlight, iOS, Windows Phone 7, etc). Right now I\'m determining whi

8条回答
  •  [愿得一人]
    2021-01-29 21:35

    Just put it this way in simplest terms, step back from underlying protocol and look at this from developer/user perspective. Web API is Microsoft's first class HTTP based Rest Framework not WCF. That means any missing Rest features, specifications, they are going to add to Web API pipe and not necessarily to WCF.

    Yes you can implement these yourself in WCF but as it says in the sentence you need to implement these yourself.

    Just as an example today implementing a 2 factor authentication for a Web API takes less than 15 minutes using OWIN which is a primarily Authentication/Authorization nuget package that started as an open source project.

    When you use a technology stack it makes a huge difference to use the first class stack for Microsoft. You would even have countless MS published sample code and projects in Github which you can simply copy and make a head start in your own project. It makes a difference on every level, documentation, code samples, feature set, support, helper api s you name it.

    So my simple advice to you, if you want to build Restfull HTTP based applications use web API (or ASP.NET Core for portability) and really stay away from WCF. If the protocol is not HTTP and it really cannot be HTTP then use WCF.

提交回复
热议问题