EndpointDispatcher Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents the run-time object that exposes properties that enable the insertion of run-time extensions or modifications for messages in service applications.
public ref class EndpointDispatcher
public class EndpointDispatcher
type EndpointDispatcher = class
Public Class EndpointDispatcher
- Inheritance
-
EndpointDispatcher
Examples
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)
{
behavior.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}
public void ApplyDispatchBehavior(ServiceEndpoint serviceEndpoint, EndpointDispatcher endpointDispatcher)
{
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new EndpointBehaviorMessageInspector());
}
public void Validate(ServiceEndpoint serviceEndpoint)
{
return;
}
Remarks
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 AddressFilter property allows you to get or set a MessageFilter object that the ChannelDispatcher uses to identify whether the endpoint can process a particular message.
The ChannelDispatcher property gets the associated ChannelDispatcher object, which sends and receives messages to and from the EndpointDispatcher and which can be used to inspect or modify other channel-related values and behaviors.
The ContractFilter gets the MessageFilter object that is used to identify whether a message is destined for this contract.
The ContractName and ContractNamespace properties return the name and namespace of the endpoint contract.
The DispatchRuntime property returns the DispatchRuntime object that you can use to modify run-time values or insert custom run-time extensions for the entire endpoint.
The EndpointAddress property gets the address of the endpoint.
The FilterPriority property returns the priority of the composite filter that the ChannelDispatcher uses to establish which endpoint is to handle the message.
Constructors
EndpointDispatcher(EndpointAddress, String, String, Boolean) |
Initializes a new instance of the EndpointDispatcher class with the specified address, contract name, contract namespace, and whether the endpoint is a public, system endpoint. |
EndpointDispatcher(EndpointAddress, String, String) |
Initializes a new instance of the EndpointDispatcher class with the specified address, contract name, and contract namespace. |
Properties
AddressFilter |
Gets or sets a MessageFilter object that is used to identify whether a particular message is destined for the endpoint address. |
ChannelDispatcher |
Gets the associated ChannelDispatcher object, which can be used to inspect or modify other channel-related values and behaviors. |
ContractFilter |
Gets or sets the MessageFilter object that is used to identify whether a message is destined for this contract. |
ContractName |
Gets the endpoint contract name. |
ContractNamespace |
Gets the namespace of the endpoint contract. |
DispatchRuntime |
Gets the DispatchRuntime object used to inspect, modify, or extend run-time behavior across a service endpoint or a client callback endpoint. |
EndpointAddress |
Gets the address of the endpoint. |
FilterPriority |
Gets or sets the priority of the ContractFilter and the AddressFilter combination when the ChannelDispatcher is selecting endpoints. |
IsSystemEndpoint |
Gets a value that indicates whether the endpoint is created internally by the server and not by the user. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |