EndpointDispatcher 类

定义

表示公开属性的运行时对象,使用这些属性可以在服务应用程序中插入运行时扩展或修改消息。

public ref class EndpointDispatcher
public ref class EndpointDispatcher sealed
public class EndpointDispatcher
public sealed class EndpointDispatcher
type EndpointDispatcher = class
Public Class EndpointDispatcher
Public NotInheritable Class EndpointDispatcher
继承
EndpointDispatcher

示例

下面的代码示例演示使用 EndpointDispatcher 来定位终结点的 System.ServiceModel.Dispatcher.DispatchRuntime,以及使用终结点行为来插入自定义消息检查器。

// IEndpointBehavior Members
public void AddBindingParameters(ServiceEndpoint serviceEndpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
{
  return;
}

public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
{
  behavior.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}

public void ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher)
{
  endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}

public void Validate(ServiceEndpoint serviceEndpoint)
{
  return;
}

注解

EndpointDispatcherSystem.ServiceModel.Dispatcher.DispatchRuntime 类公开服务中终结点的运行时自定义点。 EndpointDispatcher 可用于控制它可以处理哪些消息以及某些与终结点相关的信息。 DispatchRuntime 具有大量的属性,这些属性用于将自定义扩展插入到终结点范围运行时中。

当消息的目标地址与 EndpointDispatcher 属性相匹配并且消息操作与 System.ServiceModel.Dispatcher.ChannelDispatcher 属性相匹配时,AddressFilter 对象负责处理来自 ContractFilter 的消息。 如果两个 EndpointDispatcher 对象可以接受一个消息,则 FilterPriority 属性值确定具有较高优先级的终结点。

使用 EndpointDispatcher 对象可以配置或扩展从关联的 ChannelDispatcher 接收消息、将消息对象转换为用作参数的对象、调用终结点操作的过程,并可以扩展相反的过程。

通常情况下,终结点的 EndpointDispatcher 是通过实现 IEndpointBehavior 接口来获取的,不过您可以从其他行为接口访问 EndpointDispatcher

您可以使用以下 EndpointDispatcher 属性:

构造函数

EndpointDispatcher(EndpointAddress, String, String)

使用指定的地址、协定名称和协定命名空间初始化 EndpointDispatcher 类的新实例。

EndpointDispatcher(EndpointAddress, String, String, Boolean)

使用指定的地址、协定名称、协定命名空间初始化 EndpointDispatcher 类的新实例,并指定终结点是否为公用的系统终结点。

属性

AddressFilter

获取或设置 MessageFilter 对象,该对象用于确定是否将特定的消息发送到终结点地址。

ChannelDispatcher

获取关联的 ChannelDispatcher 对象,该对象可以用于检查或修改其他与通道相关的值和行为。

ContractFilter

获取或设置 MessageFilter 对象,该对象用于确定是否将消息发送到此协定。

ContractName

获取终结点协定名称。

ContractNamespace

获取终结点协定的命名空间。

DispatchRuntime

获取 DispatchRuntime 对象,该对象用于在整个服务终结点或客户端回调终结点中检查、修改或扩展运行时行为。

EndpointAddress

获取终结点的地址。

FilterPriority

ContractFilter 选择终结点时,获取或设置 AddressFilterChannelDispatcher 组合的优先级。

IsSystemEndpoint

获取一个值,该值指示终结点是否是由服务器(而非用户)内部创建的。

方法

Equals(Object)

确定指定对象是否等于当前对象。

(继承自 Object)
GetHashCode()

作为默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。

(继承自 Object)
ToString()

返回表示当前对象的字符串。

(继承自 Object)

适用于