Use WCF Service or ASP.NET Web api for biometric device? - wcf

I have a web application(HRMS) in asp.net MVC4 and a Windows Form (later on converted in windows service) connected to a biometric device. So question is should I use WCF Service or asp.net web api to send attendance data?
Thanks in advance

Go for ASP.NET Web API.
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. Use
ASP.NET Web API if you are creating and designing new REST-style
services. Although WCF provides some support for writing REST-style
services, the support for REST in ASP.NET Web API is more complete and
all future REST feature improvements will be made in ASP.NET Web API. If you have an existing WCF service and you want to expose
additional REST endpoints, use WCF and the WebHttpBinding.
Its better to stay with WebAPI as it looks to be more appropriate for building further real RESTfull service development. WCF was originally created to enable SOAP-based services. For simpler RESTful or RPCish services (think clients like jQuery) ASP.NET Web API should be good choice.

Related

when ASP.NET core web API app connecting call WCF service API, how to authenticate

I am developing a C# backend app using ASP.NET core web API application. Inside this API, I need to call some API(WCF SOAP service) from database. For this WCF service, we were provided pre-built .dll, so will not use adding service reference. When calling these WCF service, have to pass my windows credential to let WCF service know I am a qualified user before use the service. Now I am stuck on how I can pass my credential to this WCF. What is the right architecture to use.(Screen shot is showing some endpoint of the WCF service)
Adding some background info, In our react frontend, will call these ASP.NET core web API to get data back from WCF, and show it on frontend.
I am new to C# and .Net core. Please share some insight. Thanks a lot. Happy New Year!!!
I did the ASP.NET core web API part. but could not figure out the right way to authenticate when connecting to WCF API.

Why Restful WCF Services is preffered for Mobile Applications?

Why Restful WCF Services is preffered for Mobile Applications? Can we use normal WCF to communicate?
Mobile apps or any client can call the RESTful services directly and easily without the SOAP protocol and RESTful services return json data by default, so its easily usable on the client side. Its really difficult and cumbersome to call WCF service from mobile and other client application.
Have a look at the links below:
https://msdn.microsoft.com/en-us/library/jj823172(v=vs.110).aspx
http://www.dotnet-tricks.com/Tutorial/webapi/JI2X050413-Difference-between-WCF-and-Web-API-and-WCF-REST-and-Web-Service.html

Is there any advantage of Web API over WCF

I have experience in developing Restful web service using WCF. For the next project, I am considering Web API because that is the latest technology.
During my search, I found that an important reason for Web API recommendation is that it is Restful and can be accessed by HTTP protocol.
But we can also use WCF to create a restful web service that can be consumed even by mobile devices. I understand that to create a restful service using WCF, there is extra configuration involved, but besides that are there any other reasons for preferring Web API over WCF?
In other words, does Web API provide an exact subset of WCF functionality, or is there something you can do with Web API that you cannot do with a WCF service exposed as restful?

Asp web api vs wcf for point of sales application

I'm planning to develop a pos application for restaurant. Client will be using pc and mobile. Application will be used in local area connection. I'm still considering whether to go with wcf or web api. What are the advantages of using wcf/web api for the type of application i'm building?
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.
Use ASP.NET Web API if you are creating and designing new REST-style services. Although WCF provides some support for writing REST-style services, the support for REST in ASP.NET Web API is more complete and all future REST feature improvements will be made in ASP.NET Web API.
If you have an existing WCF service and you want to expose additional REST endpoints, use WCF and the WebHttpBinding.
from the official Microsoft Documentation.
Essentially, my take on this is that WCF is much more difficult to work with, and not completely compatible out of the box with many mobile clients, so only use it if you know that it's something you need.

What is the difference between Asp.Net Web API and WCF Service?

Since last few months this Asp.Net Web API seems to be an highlighted product from Microsoft. Is it an alternative to WS* Service. How is it different than WCF Service? And where can we see it as a best fit in web application development?
ASP.NET Web API is a framework for building web services that are exposed over HTTP. It is very well suited to (but not limited to) building RESTful web services.
Such web services are an alternative to building a SOAP RPC / WS* web services in that they are simpler, more light weight, and there's less coupling between client and server.
A traditional "WCF Service" supports SOAP RPC as opposed to REST, and these services tend to be complex and to have a tight coupling between client and server. Wide interoperability can become difficult to achieve. However, a traditional WCF Service can communicate over a wide variety of protocols - TCP being a particularly useful one for internal services (services in the same DMZ).
(While WCF is mostly associated with SOAP RPC-style services, there are at least three attempts in WCF to support the building of RESTful web services. These attempts have all been superseded by the ASP.NET Web API.)
ASP.NET Web API is a best fit for producing public facing RESTful web services - aka Hypermedia APIs - over HTTP. To do this, having a good understanding of the REST architectural style is important before you start using the ASP.NET Web API. See such books as "REST in Practice", "The RESTful Web Services Cookbook" and "Building Hypermedia APIs with HTML5 and Node".
Difference between ASP.net Web API and WCF API
Web service is a part of WCF. WCF offers much more flexibility and portability to develop a service when comparing to web service. Still we are having more advantages over Web service, following table provides detailed difference between them.