語言

MsmqIntegrationBindingElement.BuildChannelFactory<TChannel> 方法

定義

利用提供的上下文建立通道工廠。

public:
generic <typename TChannel>
 override System::ServiceModel::Channels::IChannelFactory<TChannel> ^ BuildChannelFactory(System::ServiceModel::Channels::BindingContext ^ context);
public override System.ServiceModel.Channels.IChannelFactory<TChannel> BuildChannelFactory<TChannel>(System.ServiceModel.Channels.BindingContext context);
override this.BuildChannelFactory : System.ServiceModel.Channels.BindingContext -> System.ServiceModel.Channels.IChannelFactory<'Channel>
Public Overrides Function BuildChannelFactory(Of TChannel) (context As BindingContext) As IChannelFactory(Of TChannel)

類型參數

TChannel

頻道的類型。

參數

context
BindingContext

用來 BindingContext 建造水道工廠。

傳回

一個 MSMQ 整合通道工廠,可用來建立通道,向現有 MSMQ 應用程式發送訊息。

例外狀況

上下文值為 null。

該 TChannel 並非 IOutputChannel。

ExactlyOnce是true且 Durable 。false

-或-

CustomDeadLetterQueue 不是 null,DeadLetterQueue 也不是 Custom。

-或-

在 Windows 2003/XP 上,DeadLetterQueue 設定為自訂。

-或-

ExactlyOnce 是錯誤的,DeadLetterQueue 是自訂的。

-或-

CustomDeadLetterQueue 是設定的,如果沒有寫入權限寫入隊列,或隊列不存在,則

-或-

如果 CustomDeadLetterQueue 是非交易型的。

-或-

MsmqAuthenticationMode 設定為 WindowsDomain,且如果安裝 MSMQ 未進行Active Directory整合。

-或-

MsmqAuthenticationMode 是無,也 MsmqProtectionLevel 不是無。

-或-

MsmqAuthenticationMode 是憑證或 WindowsDomain,且 MsmqProtectionLevel 為 None。

備註

此方法建構通道工廠,使開發者能建立客戶端通道與服務通訊。 通道工廠不是通道,而是能創造通道的工廠。 你透過呼叫 IChannelFactory<TChannel>.CreateChannel來建立一個通道。

適用於