0
votes

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?

1
one thing i liked when using wcf is the flexibility it offers to support both soap and http services - DarkMakukudo
Supports building services with WS-* standards like Reliable Messaging, Transactions, Message Security. from this article msdn.microsoft.com/en-us/library/jj823172(v=vs.110).aspx WCF is more secure but it also depends on how you implement it - DarkMakukudo
@IRPunch Use WCF to create reliable, secure web services that accessible over a variety of transports. Use ASP.NET Web API to create HTTP-based services that are accessible from a wide variety of clients. - Uali

1 Answers

0
votes

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