Web 服务与 WCF 服务 [英] Web Service vs WCF Service

查看:36
本文介绍了Web 服务与 WCF 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它们之间有什么区别?

What is the difference between them?

我什么时候会选择一个而不是另一个?

When would I opt for one over the other?

推荐答案

此答案基于已不存在的文章:

This answer is based on an article that no longer exists:

文章摘要:

基本上,WCF 是一个服务层,它允许您构建可以使用各种通信机制进行通信的应用程序.有了它,您就可以使用点对点、命名管道、Web 服务等进行通信.

"Basically, WCF is a service layer that allows you to build applications that can communicate using a variety of communication mechanisms. With it, you can communicate using Peer to Peer, Named Pipes, Web Services and so on.

您无法比较它们,因为 WCF 是用于构建可互操作的应用程序的框架.如果您愿意,可以将其视为 SOA 推动者.这是什么意思?

You can’t compare them because WCF is a framework for building interoperable applications. If you like, you can think of it as a SOA enabler. What does this mean?

好吧,WCF 符合称为 ABC 的东西,其中 A 是您要与之通信的服务的地址,B 代表绑定,C 代表合同.这很重要,因为无需更改代码即可更改绑定.合约更强大,因为它强制将合约与实现分离.这意味着契约是在一个接口中定义的,并且有一个具体的实现,消费者使用契约的相同思想绑定到它.数据模型被抽象出来了."

Well, WCF conforms to something known as ABC, where A is the address of the service that you want to communicate with, B stands for the binding and C stands for the contract. This is important because it is possible to change the binding without necessarily changing the code. The contract is much more powerful because it forces the separation of the contract from the implementation. This means that the contract is defined in an interface, and there is a concrete implementation which is bound to by the consumer using the same idea of the contract. The datamodel is abstracted out."

...稍后...

当我们需要与其他通信技术(例如点对点、命名管道)而不是 Web 服务进行通信时,应该使用 WCF"

"should use WCF when we need to communicate with other communication technologies (e,.g. Peer to Peer, Named Pipes) rather than Web Service"

这篇关于Web 服务与 WCF 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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