MsmqIntegrationBindingElement.BuildChannelListener<TChannel> 方法

定義

使用提供的內容建置通道接聽程式。

public:
generic <typename TChannel>
 where TChannel : class, System::ServiceModel::Channels::IChannel override System::ServiceModel::Channels::IChannelListener<TChannel> ^ BuildChannelListener(System::ServiceModel::Channels::BindingContext ^ context);
public override System.ServiceModel.Channels.IChannelListener<TChannel> BuildChannelListener<TChannel> (System.ServiceModel.Channels.BindingContext context) where TChannel : class, System.ServiceModel.Channels.IChannel;
override this.BuildChannelListener : System.ServiceModel.Channels.BindingContext -> System.ServiceModel.Channels.IChannelListener<'Channel (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)> (requires 'Channel : null and 'Channel :> System.ServiceModel.Channels.IChannel)
Public Overrides Function BuildChannelListener(Of TChannel As {Class, IChannel}) (context As BindingContext) As IChannelListener(Of TChannel)

類型參數

TChannel

通道的類型。

參數

context
BindingContext

用來建置通道接聽程式的 BindingContext

傳回

IChannelListener<TChannel>

MSMQ 整合通道接聽程式,它可用來建立通道,以便從現有的 MSMQ 應用程式接收訊息。

例外狀況

內容值為 null

TChannel 不是 IInputChannel

ExactlyOnce 是 true 而 Durable 是 false

-或-

無法讀取佇列。

-或-

ExactlyOnce 為 true,而佇列為非異動式。

-或-

ExactlyOnce 為 false,而佇列為異動式。

-或-

ReceiveErrorHandling 設定為 Move,而 Windows Vista 中的佇列名稱包含 ";"。

-或-

ExactlyOnce 設定為 true,而且在 Windows Vista 中無法開啟重試子佇列。

-或-

ReceiveErrorHandling 設定為 Reject 或 Move,而且平台為 Windows Vista。

-或-

MsmqAuthenticationMode 設定為 WindowsDomain,而且如果未使用 Active Directory 整合安裝 MSMQ。

-或-

MsmqAuthenticationMode 是 None,而 MsmqProtectionLevel 不是 None。

-或-

MsmqAuthenticationMode 是 Certificate 或 WindowsDomain 而 MsmqProtectionLevel 是 None。

備註

通道接聽程式是在服務上建立的,而且可以用來接收用戶端通道所傳送的訊息。 服務必須依序呼叫 IChannelListener.OpenIChannelListener.AcceptChannel,才會取得實際通道的參考。 接著,則必須呼叫 IChannel.Open 來開啟通道。 此時,此通道才可以用來擷取訊息。

適用於