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

ExactlyOncetrue,而 Durablefalse

-或-

CustomDeadLetterQueue 不是 null,而 DeadLetterQueue 不是 Custom。

-或-

DeadLetterQueue 在 Windows 2003/XP 上設定為 Custom。

-或-

ExactlyOnce 為 false,而 DeadLetterQueue 為 Custom。

-或-

CustomDeadLetterQueue 已設定,而且沒有可寫入佇列的寫入權限或是佇列不存在。

-或-

如果 CustomDeadLetterQueue 為非交易式。

-或-

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

-或-

MsmqAuthenticationMode 是 None,而 MsmqProtectionLevel 不是 None。

-或-

MsmqAuthenticationMode 是 Certificate 或 WindowsDomain 而 MsmqProtectionLevel 是 None。

備註

這個方法會建置通道處理站,以便開發人員用來建立可與服務進行通訊的用戶端通道。 通道處理站並不是通道,而是能夠建立通道的處理站。 您可以呼叫 IChannelFactory<TChannel>.CreateChannel 來建立通道。

適用於