The difference between WCF, Web API, WCF REST, Web service

Source: Internet
Author: User

http://www.dotnet-tricks.com/Tutorial/webapi/ Ji2x050413-difference-between-wcf-and-web-api-and-wcf-rest-and-web-service.html

The. NET framework has a number of techniques for creating HTTP service, such as Web service, WCF, and Web APIs. Here's a look at the difference:

Web Service

    • SOAP-based and returns XML data.
    • Only HTTP protocols are supported.
    • Non-open source, but XML can be understood and used by all clients.
    • Can only reside in IIS.

Wcf

    • It is also soap-based and returns XML data.
    • is the evolutionary version of Web Service (ASMX) and supports various protocols such as TCP, HTTP, HTTPS, Named Pipes, MSMQ.
    • The main problem with WCF is the cumbersome, extensible configuration.
    • Non-open source, but XML can be understood and used by all clients.
    • Be able to reside in IIS or other Window Service (window services).

WCF REST

    • To use WCF as a WCF Rest Service, you must support webhttpbinding.
    • It supports HTTP get and post.
    • If you want to support other HTTP verbs, you must set IIS to accept the other verb.
    • Passing data through parameters using a webget need configuration. The UriTemplate must be specified.
    • Supports XML, JSON, and atom data formats.

Web API

    • The the new framework for building HTTP services with easy and simple.
    • Web API is open source a ideal platform for building rest-ful services over the. NET Framework.
    • Unlike WCF Rest service, it use the full featues of HTTP (like URIs, Request/response headers, caching, versioning, Variou s content formats)
    • It also supports the MVC features such as routing, Controllers, action results, filter, model binders, IOC container or de pendency injection, unit testing that makes it more simple and robust.
    • It can be hosted with the application or on IIS.
    • It's light weight architecture and good for devices which has limited bandwidth like smart phones.
    • Responses is formatted by Web API ' s mediatypeformatter into JSON, XML or whatever format you want to add as a mediatypefo Rmatter

The difference between WCF, Web API, WCF REST, Web service

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.