Web Service vs wcf rest vs Web API, wcfrest
[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. return data in XML format based on the SOAP protocol.
2. Only HTTP is supported.
3. It is not open-source and can be used on all clients that can parse XML.
4. You can only host on IIS.
WCF
1. Data is also returned in XML format based on the SOAP protocol.
2. It is an upgrade of Web Service (ASMX) and supports multiple protocols, such as TCP, HTTP, HTTPS, Named Pipes, and MSMQ.
3. the WCF configuration is too complicated.
4. It is not open-source and can be used on all clients that can parse XML.
5. Can host in applications, IIS and Windows Services.
WCF REST
1. You need to enable webHttpBindings.
2. Support http get and POST by adding the [WebGet] and [WebInvoke] attributes.
3. If you want to use other HTTP request methods (e.g. PUT, DELETE), you need to configure additional parameters in IIS.
4. to transmit data through URL parameters, you must configure WebGet and specify the UriTemplate.
5. Supports XML, JSON, and other data formats.
WEB API
1. A new framework provided by Microsoft to create HTTP services more easily and easily.
2. Open-source projects are an ideal platform for building a REST-ful service on the. NET platform.
3. Compared with WCF Rest, Web APIs support 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, and unit testing.
5. You can host on an application or IIS.
6. It is a lightweight architecture that can be better used for devices with limited bandwidth such as smart phones.
7. MediaTypeFormatter can return JSON, XML, or other custom data.