简体   繁体   中英

AngularJS - Which is good WCF Rest or Web API

I'm going to start a new AngularJS Project blended with Microsoft .NET. Now I'm confused which one should I select, WCF Rest or Web API ?

My Angular App has a Login Module and a Main Application. Only the authenticated user can access the Main Application. In Web API we have to use Token System or Owin Auth, but some blogs are saying its not so secure. So, I am totally confused which should I choose ? which one is efficient and secure ?

WCF Rest

  1. To use WCF as WCF Rest service we have to enable webHttpBindings .
  2. It supports HTTP GET and POST verbs by [WebGet] and [WebInvoke] attributes respectively.
  3. To enable other HTTP verbs we have to do some configuration in IIS to accept request of that particular verb on .svc files
  4. Passing data through parameters using a WebGet needs configuration. The UriTemplate must be specified
  5. It supports XML, JSON and ATOM data format.

Web API

  1. This is the new framework for building HTTP services with easy and simple way.
  2. Web API is open source, an ideal platform for building REST-ful services over the .NET Framework.
  3. Unlike WCF Rest service, it uses the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats)
  4. It also supports the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection, unit testing that makes it more simple and robust.
  5. It can be hosted with in the application or on IIS.
  6. It is light weight architecture and good for devices which have limited bandwidth like smart phones.
  7. Responses are formatted by Web API's MediaTypeFormatter into JSON, XML or whatever format you want to add as a MediaTypeFormatter .

Kindly assist me, which one is efficient and secure?

Nancy

  1. Lighter-weight than either web-api or WCF
  2. Convention-based, low on ceremony
  3. As fully featured as WebAPI in terms of HTTP support
  4. Supports Razor view engine
  5. Supports OWIN pipeline
  6. Comes with its own IOC out of the box

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM