什么是Asp.Net的Web API和WCF服务之间的区别? [英] What is the difference between Asp.Net Web API and WCF Service?

查看:290
本文介绍了什么是Asp.Net的Web API和WCF服务之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于过去几个月这个Asp.Net的Web API似乎是从微软的强调,产品。难道是WS *服务的替代品。它是如何比WCF服务有什么不同?而我们在这里可以看到它在Web应用程序开发最适合的?

Since last few months this Asp.Net Web API seems to be an highlighted product from Microsoft. Is it an alternative to WS* Service. How is it different than WCF Service? And where can we see it as a best fit in web application development?

推荐答案

的ASP.NET Web API是用于构建暴露了HTTP Web服务的框架。这是很好的适合于(但不限于)构建RESTful Web服务。

ASP.NET Web API is a framework for building web services that are exposed over HTTP. It is very well suited to (but not limited to) building RESTful web services.

这样的Web服务是构建一个SOAP RPC / WS替代*,因为它们更简单,重量越来越轻,并有客户端和服务器之间的耦合少。网络服务

Such web services are an alternative to building a SOAP RPC / WS* web services in that they are simpler, more light weight, and there's less coupling between client and server.

一个传统的WCF服务支持SOAP RPC,而不是休息,而这些服务往往是复杂的,有客户端和服务器之间的紧密耦合。宽的互操作性可能变得难以实现。然而,传统的WCF服务可以在通信的各种协议的 - TCP是用于内部服务(在相同的DMZ服务)的特别有用的有一个

A traditional "WCF Service" supports SOAP RPC as opposed to REST, and these services tend to be complex and to have a tight coupling between client and server. Wide interoperability can become difficult to achieve. However, a traditional WCF Service can communicate over a wide variety of protocols - TCP being a particularly useful one for internal services (services in the same DMZ).

(WCF虽然大多与SOAP RPC风格的服务有关,至少有三次在WCF中支持REST Web服务建设。这些尝试都被的ASP.NET Web API取代。)

(While WCF is mostly associated with SOAP RPC-style services, there are at least three attempts in WCF to support the building of RESTful web services. These attempts have all been superseded by the ASP.NET Web API.)

的ASP.NET Web API是生产面向公众的REST Web服务的最佳拟合 - 通过HTTP - 又名超媒体的API。要做到这一点,有REST架构风格的一个很好的理解你开始使用ASP.NET Web API之前是很重要的。看到这样的书籍,REST风格的Web服务菜谱和使用HTML5和节点建设超媒体的API。

ASP.NET Web API is a best fit for producing public facing RESTful web services - aka Hypermedia APIs - over HTTP. To do this, having a good understanding of the REST architectural style is important before you start using the ASP.NET Web API. See such books as "REST in Practice", "The RESTful Web Services Cookbook" and "Building Hypermedia APIs with HTML5 and Node".

这篇关于什么是Asp.Net的Web API和WCF服务之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆