简体   繁体   English

WCF VS REST API?

[英]WCF VS REST API?

I want to understand the WCF and REST API implementation. 我想了解WCF和REST API实现。 As per internet information, REST concept was introduced by Roy Fielding in year 2000 and WFC was incorporated in .Net framework on 2006. If REST concept was best then Why Microsoft introduced WCF and now REST API became popular.SOAP is now largely obsolete. 根据互联网信息,REST概念由Roy Fielding在2000年引入,WFC在2006年被纳入.Net框架。如果REST概念最好,那么为什么Microsoft引入了WCF,现在REST API变得流行。现在SOAP已经基本上过时了。 Really appreciate if anyone can provide insights on this. 真的很感激,如果有人能提供这方面的见解。

There are a number of technologies that can help you develop HTTP Web Services like Web Service, WCF and WEB API. 有许多技术可以帮助您开发Web服务,如Web服务,WCF和WEB API。

Rest on the other hand is not a technology but an architectural style for creating Web Services so every service that follows a REST Architecture is called RESTful web services/API 另一方面,休息不是一种技术,而是一种用于创建Web服务的架构风格,因此遵循REST架构的每个服务都称为RESTful Web服务/ API

read REST constraints here: Rest Constraints 在这里阅读REST约束: Rest Constraints

The main differences between WCF and WEB API are: WCF和WEB API之间的主要区别是:

WCF is SOAP-based and return data in XML, It requires more configuration, It supports more web protocols like HTTP, TCP, UDP, custom etc, is not open source, supports duplex message exchange patterns etc WCF是基于SOAP的,以XML格式返回数据,需要更多配置,支持更多Web协议,如HTTP,TCP,UDP,自定义等,不是开源,支持双工消息交换模式等

Web API is REST-based framework for building HTTP Services, more suitable for connecting through any device, much less configuration, supports fewer protocols, supports request-response protocol [means every request should contain enough information for the response but it can be modified using Signal R and Web Sockets etc], is open source Web API是基于REST的框架,用于构建HTTP服务,更适合通过任何设备进行连接,更少的配置,支持更少的协议,支持请求 - 响应协议[意味着每个请求都应包含足够的响应信息,但可以使用Signal R和Web Sockets等]是开源的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM