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

取得或設定 ContractFilterAddressFilter 組合在 ChannelDispatcher 選取端點時的優先順序。

IsSystemEndpoint

取得值,指出端點是否一開始是由伺服器建立而不是使用者。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於