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
- To use WCF as WCF Rest service we have to enable
webHttpBindings. - It supports HTTP GET and POST verbs by
[WebGet]and[WebInvoke]attributes respectively. - To enable other HTTP verbs we have to do some configuration in IIS to accept request of that particular verb on .svc files
- Passing data through parameters using a
WebGetneeds configuration. TheUriTemplatemust be specified - It supports XML, JSON and ATOM data format.
Web API
- This is the new framework for building HTTP services with easy and simple way.
- Web API is open source, an ideal platform for building REST-ful services over the .NET Framework.
- Unlike WCF Rest service, it uses the full features of HTTP (like URIs, request/response headers, caching, versioning, various content formats)
- 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.
- It can be hosted with in the application or on IIS.
- It is light weight architecture and good for devices which have limited bandwidth like smart phones.
- Responses are formatted by Web API’s
MediaTypeFormatterinto JSON, XML or whatever format you want to add as aMediaTypeFormatter.
Kindly assist me, which one is efficient and secure?
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