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。

- 或 -

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

- 或 -

ExactlyOnce 为 false,而 DeadLetterQueue 为 Custom。

- 或 -

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

- 或 -

CustomDeadLetterQueue 是非事务性的。

- 或 -

MsmqAuthenticationMode 设置为 WindowsDomain,且 MSMQ 是在没有 Active Directory 集成的情况下安装的。

- 或 -

MsmqAuthenticationMode 为 None,而 MsmqProtectionLevel 不为 None。

- 或 -

MsmqAuthenticationMode 为 Certificate 或 WindowsDomain,而 MsmqProtectionLevel 为 None。

注解

此方法可生成通道工厂,这样开发人员就可创建客户端通道,从而与服务进行通信。 通道工厂不是一个通道,而是一个能够创建通道的工厂。 您可通过调用 IChannelFactory<TChannel>.CreateChannel 来创建通道。

适用于