Windows 通信基础 (WCF):
WCF 用于创建分布式和可互操作的应用程序。它提供了一个框架,用于构建面向服务的连接应用程序,以异步传输数据,从一个服务点到另一个服务点。以前称为 Indigo,是用于构建、配置和部署网络分布式服务的框架。
Web 应用程序编程接口 (Web API):
ASP.NET 提供了 ASP.NET Web Pages、ASP.NET MVC、Web Forms 3 种开发风格来创建 Web 应用程序。它类似于 webservice 或 WCF 服务,但例外是它只支持 HTTP 协议。
WCF和Web API的区别:
SR.NO. | WCF | WEB API |
---|---|---|
1 | WCF ships with .NET framework to create secure, reliable, and high profile development solutions. | While, WEB API is a open source and also ships with .NET framework. |
2 | WCF offers supports for limited RESTFUL service. | WEB API is ideal for building RESTFUL services. |
3 | WCF used the web.config and attributes to configure a HttpConfiguration class | Web API can be configured using web.config service. |
4 | It depend on the attributes based programming model. | WEB API maps http verbs to methods |
5 | WCF does not provide any support for MVC features like controllers, routing, filter, auction results, etc. | ASP.NET Web API supports MVC features like routing, controllers, results, filter, action, etc. |
6 | It is not open source software. | It is shipped with.Net framework.It is also available as an independent download. |
7 | It rely on IIS hosting, Self-hosting & works activation services. | It rely on Self-hosting & IIS hosting. |