Web Service vs wcf rest vs Web API, wcfrest

Source: Internet
Author: User

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.

Related Article

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.