MsmqTransportBindingElement::BuildChannelFactory<TChannel> Method (BindingContext^)
Builds a channel factory using the context provided.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
public: generic<typename TChannel> virtual IChannelFactory<TChannel>^ BuildChannelFactory( BindingContext^ context ) override
Parameters
- context
-
Type:
System.ServiceModel.Channels::BindingContext^
The BindingContext with which to build the channel factory.
Return Value
Type: System.ServiceModel.Channels::IChannelFactory<TChannel>^A Message Queuing (MSMQ) channel factory that can be used to create channels to send messages to existing Message Queuing applications.
Type Parameters
- TChannel
A IOutputSessionChannel or a IOutputChannel class.
| Exception | Condition |
|---|---|
| ArgumentNullException | The context value is null. |
| ArgumentException | The TChannel is not IOutputChannel or IOutputSessionChannel. |
| InvalidOperationException | ExactlyOnce is true and Durable is false. |
| InvalidOperationException | UseActiveDirectory is true and QueueTransferProtocol is not Native. |
| InvalidOperationException | CustomDeadLetterQueue is not null and DeadLetterQueue is not Custom. |
| InvalidOperationException | DeadLetterQueue is set to Custom on Windows 2003/XP. |
| InvalidOperationException | ExactlyOnce is false and DeadLetterQueue is Custom. |
| InvalidOperationException | CustomDeadLetterQueue is set and if there is no write permission to write to queue or if queue does not exist. |
| InvalidOperationException | If CustomDeadLetterQueue is non-transactional. |
| InvalidOperationException | MsmqTransportSecurity.MsmqAuthenticationMode is set to WindowsDomain and if MSMQ is installed without ActiveDirectory integration. |
| InvalidOperationException | MsmqTransportSecurity.MsmqAuthenticationMode is None and MsmqTransportSecurity.MsmqProtectionLevel is not None. |
| InvalidOperationException | MsmqTransportSecurity.MsmqAuthenticationMode is Certificate or WindowsDomain and MsmqTransportSecurity.MsmqProtectionLevel is None. |
| InvalidOperationException | MsmqTransportSecurity.MsmqProtectionLevel is EncryptAndSign and UseActiveDirectory is false. |
A channel factory is created and initialized using the properties that have been set in the binding element. The initialized channel factory is then used to create output channels that can be used to send messages to a message queue.
Available since 3.0