MsmqIntegrationBindingElement::BuildChannelListener<TChannel> Method (BindingContext^)
Builds a channel listener using the context provided.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
public: generic<typename TChannel> where TChannel : ref class, IChannel virtual IChannelListener<TChannel>^ BuildChannelListener( BindingContext^ context ) override
Parameters
- context
-
Type:
System.ServiceModel.Channels::BindingContext^
The BindingContext with which to build the channel listener.
Return Value
Type: System.ServiceModel.Channels::IChannelListener<TChannel>^An MSMQ integration channel listener that can be used to create channels to receive messages from existing MSMQ applications.
Type Parameters
- TChannel
The type of channel.
| Exception | Condition |
|---|---|
| ArgumentNullException | The context value is null. |
| ArgumentException | The TChannel is not IInputChannel. |
| InvalidOperationException | ExactlyOnce is true and Durable is false. |
| InvalidOperationException | Queue not readable. |
| InvalidOperationException | ExactlyOnce is true and queue is non-transactional. |
| InvalidOperationException | ExactlyOnce is false and queue is transactional. |
| InvalidOperationException | ReceiveErrorHandling is set to Move and queue name contains a ";" in Windows Vista. |
| InvalidOperationException | ExactlyOnce is set to true and cannot open retry sub-queue in Windows Vista. |
| InvalidOperationException | ReceiveErrorHandling is set to Reject or Move and the platform is Windows Vista. |
| InvalidOperationException | MsmqAuthenticationMode is set to WindowsDomain and if MSMQ is installed without Active Directory integration. |
| InvalidOperationException | MsmqAuthenticationMode is None and MsmqProtectionLevel is not None. |
| InvalidOperationException | MsmqAuthenticationMode is Certificate or WindowsDomain and MsmqProtectionLevel is None. |
Channel listeners are created on the service and are used to receive messages sent by a client channel. The service must call IChannelListener.Open and then IChannelListener.AcceptChannel to get a reference to the actual channel. Then IChannel.Open must be called to open the channel. At this point, the channel can be used to retrieve messages.
Available since 3.0