I have a new project I am working on. The purpose of the project is to centralize all service calls and provide a single entry point to other services.
Currently, there are about 5 different services that that developers call to get data from different sources internally.
This project would create a single service that other developers in the company can use to call all these 5 different services from a single service.
My question is
should I build the service using Web API (RESTful) or WCF (SOAP based)?
I was suggested by my manager to use a restful approach to creating this service. However, since this service is used internally in the company, i believe WCF would be a more appropriate approach because of WSDL, which you can use to create proxy classes and use objects instead of the client parsing the data returned.
Also, WCF is action driven and Web API is resource driven.
when do you use action driven model and when do you use resource driven?
I would appreciate it if you could provide insight into my situation and help me decide which approach to apply to my project.
Here is what I have so far, but it's still not enough to convince me to use one or the other.
WCF
- SOAP based services
- Multiple transport protocol (HTTP, TCP, UDP, etc.)
- WSDL for creating proxies (generate type safe binder classes/objects)
- It allows the client to reference the service endpoint just like a class library, which means you're not dealing in XML or JSON in your desktop client. You're working with classes & objects.
- Has more overhead compared to Web API
- Internal/Intranet
- Action-driven model that focuses on what actions a service is a capable of performing
- WCFExtras+ for documenting service
Web API
- RESTful services
- HTTP based (first class citizen)
- Wide variety of media types (XML, JSON)
- Light weight
- No WSDL (often clients end up parsing the data on their own)
- Public API (wide variety of clients)
- Resource-driven architecture that exposes endpoints based on objects and not functions
- Client Interoperability
- ASP.NET Web API Help Pages using Swagger
UPDATE:
my question is understanding why WCF should be used for intranet application. is it because of WSDL, which creates proxy classes for you automatically and web api, you have to do more work on the client side for parsing the returned xml or json?