Export (0) Print
Expand All

EndpointDispatcher Class

The run-time object that exposes properties that enable the insertion of run-time extensions or modifications for messages in service applications.

Namespace:  System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public class EndpointDispatcher

The EndpointDispatcher and the System.ServiceModel.Dispatcher.DispatchRuntime classes expose the runtime customization points for endpoints in a service. The EndpointDispatcher can be used to control which messages it can process and some endpoint-related information. The DispatchRuntime has a large number of properties used to insert custom extensions into the endpoint-wide runtime.

The EndpointDispatcher object is responsible for processing messages from a System.ServiceModel.Dispatcher.ChannelDispatcher when the destination address of a message matches the AddressFilter property and the message action matches the ContractFilter property. If two EndpointDispatcher objects can accept a message, the FilterPriority property value determines the higher priority endpoint.

Use the EndpointDispatcher object to configure or extend the process of receiving messages from the associated ChannelDispatcher, converting from message objects to objects used as parameters, and invoking an endpoint operation as well as the reverse process.

Typically, the EndpointDispatcher for an endpoint is obtained by implementing the IEndpointBehavior interface, but you can access the EndpointDispatcher from the other behavior interfaces.

You can use the following EndpointDispatcher properties:

The following code example shows the use of EndpointDispatcher to locate the System.ServiceModel.Dispatcher.DispatchRuntime for the endpoint and inserts a custom message inspector using an endpoint behavior.

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

public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
{
  throw new Exception("The EndpointBehaviorMessageInspector is not used in client applications.");
}

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

public void Validate(ServiceEndpoint serviceEndpoint)
{
  return;
}

System.Object
  System.ServiceModel.Dispatcher.EndpointDispatcher

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

ADD
Show:
© 2014 Microsoft