Share via


MsmqTransportBindingElement.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

一个 IOutputSessionChannelIOutputChannel 类。

参数

context
BindingContext

用以生成通道工厂的 BindingContext

返回

一个消息队列 (MSMQ) 通道工厂,用于创建可向现有消息队列应用程序发送消息的通道。

例外

上下文值为 null。

TChannel 不为 IOutputChannel 或 IOutputSessionChannel。

ExactlyOnce 为 true,而 Durable 为 false。

- 或 -

UseActiveDirectory 为 true,而 QueueTransferProtocol 不为 Native。

- 或 -

CustomDeadLetterQueue 不为 null,DeadLetterQueue 不为 Custom。

- 或 -

在 Windows 2003/XP 中,DeadLetterQueue 设置为 Custom。

- 或 -

ExactlyOnce 为 false,而 DeadLetterQueue 为 Custom。

- 或 -

设置了 CustomDeadLetterQueue,但是对队列没有写权限或队列不存在。

- 或 -

CustomDeadLetterQueue 是非事务性的。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 设置为 WindowsDomain,而 MSMQ 是在没有 ActiveDirectory 集成的情况下安装的。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 为 None,而 MsmqTransportSecurity.MsmqProtectionLevel 不为 None。

- 或 -

MsmqTransportSecurity.MsmqAuthenticationMode 为 Certificate 或 WindowsDomain,而 MsmqTransportSecurity.MsmqProtectionLevel 为 None。

- 或 -

MsmqTransportSecurity.MsmqProtectionLevel 为 EncryptAndSign,而 UseActiveDirectory 为 false。

示例

transportBindingElement.BuildChannelFactory<IOutputChannel>(context);

注解

通道工厂是使用绑定元素中设置的属性创建并初始化的。 然后,已初始化的通道工厂用于创建输出通道,这些通道可用于向消息队列发送消息。

适用于