[MY NOTE]
Translate Source:http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service
Web Service
1. Returns data in XML format based on the SOAP protocol.
2. Only the HTTP protocol is supported.
3. Not open source, can be used for all clients that can parse XML.
4. Can only be hosted on IIS.
Wcf
1. It is also based on the SOAP protocol, which returns data in XML format.
2. is a web Service (ASMX) upgrade that supports a variety of protocols such as: TCP, HTTP, HTTPS, Named Pipes, MSMQ.
3.WCF configuration is too complex.
4. Not open source, can be used for all clients that can parse XML.
5. Ability to host in applications, IIS and Windows services.
WCF REST
1. You need to enable webhttpbindings.
2. Support for HTTP GET and post, implemented by adding [WebGet] and [WebInvoke] properties.
3. If you need to use a different HTTP request method (e.g. PUT, DELETE), requires additional configuration in IIS.
4. Transferring data via URL parameters requires a webget configuration, which must be specified uritemplate.
5. Support XML, JSON and other data formats.
WEB API
1. Microsoft provides a new framework for creating HTTP services more easily and conveniently.
2. Open source project, is in. NET platform to build rest-ful services.
3. Compared to WCF rest, the Web API supports all HTTP features (like URIs, Request/response headers, caching, versioning, various content formats.).
4. MVC features are also supported, such as routing, Controllers, action results, filter, model binders, IOC container or dependency injection, Unit Testi Ng
5. Can be hosted on the application or IIS.
6. Is a lightweight architecture that can be better used for devices with limited bandwidth like smartphones.
7. When you return data, you can return JSON, XML, or other custom data through Mediatypeformatter.
Web Service vs WCF vs WCF REST vs Web API