Web Service vs WCF vs WCF REST vs Web API

Source: Internet
Author: User

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.