且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是"端点"在WCF?

更新时间:2022-06-21 08:48:54

端点是什么服务公开,并在WCF方面,由三个东西:

An endpoint is what a service exposes, and in WCF terms, is made up of three things:


  • 地址

  • 绑定

  • 合同

地址是由端点可以到达的URL。

Address is the URL by which the endpoint can be reached.

发送到该地址处的合同执行情况的信息的应用以及形状(在某种程度上)绑定使然转换。

Binding dictates transformations that are applied as well as the shape (to some degree) of the messages sent to the implementation of the Contract at the Address.

合同规定的地址被暴露了什么操作。这也正是它说,这是,这是一个合同,指出哪些调用是允许的。

Contract dictates what operations are being exposed at the address. It's exactly what it says it is, it's a contract to indicate what calls are permissible.

在大多数情况下,人们记住了它作为AB℃。

Most of the time, people remember it as A B C.

需要注意以下几点:

绑定通常会与行为应用渠道的组合;渠道是其中修改的消息,他们得到的服务实现之前执行的操作通道堆栈上的元素。

The binding is typically going to be a combination of channels with behaviors applied; channels being elements on the channel stack which modify the message and perform actions before they get to the service implementation.

同时常用在.NET接口来表示,它不一个合同以这种方式表示的要求。一些设计第一提倡将定义的模式,以所要的请求和响应第一,这是什么的WCF变换.NET合同接口到要被发送的消息。

While commonly represented by an interface in .NET, it is not a requirement that a Contract be represented in this manner. Some design-first advocates will define the schemas to the messages that are going to be sent for the request and the response first, which is what WCF transforms the .NET Contract interface into.