This documentation is archived and is not being maintained.

MsmqTransportBindingElement Class

Represents the binding element used to specify the queuing communication properties for a service that uses the native Message Queuing (MSMQ) protocol.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public sealed class MsmqTransportBindingElement : MsmqBindingElementBase

The MsmqTransportBindingElement type exposes the following members.

Public methodMsmqTransportBindingElementInitializes a new instance of the MsmqTransportBindingElement class.

Public propertyCustomDeadLetterQueueGets or sets a Uri that identifies a custom dead-letter queue where expired messages or messages that failed to be delivered are sent. (Inherited from MsmqBindingElementBase.)
Public propertyDeadLetterQueueGets or sets the DeadLetterQueue setting for this binding. (Inherited from MsmqBindingElementBase.)
Public propertyDurableGets or sets a value that specifies whether messages sent with this binding are durable or volatile. (Inherited from MsmqBindingElementBase.)
Public propertyExactlyOnceGets or sets a value that specifies whether messages sent with this binding have exactly once assurances. (Inherited from MsmqBindingElementBase.)
Public propertyManualAddressingGets or sets a value that indicates whether manual addressing of the message is required. (Inherited from TransportBindingElement.)
Public propertyMaxBufferPoolSizeGets or sets the maximum size of any buffer pools used by the transport. (Inherited from TransportBindingElement.)
Public propertyMaxPoolSizeGets or sets an integer that specifies the maximum size of the pool that contains internal Message Queuing (MSMQ) message objects.
Public propertyMaxReceivedMessageSizeGets and sets the maximum allowable message size that can be received. (Inherited from TransportBindingElement.)
Public propertyMaxRetryCyclesGets or sets the maximum number of retry cycles to attempt delivery of messages to the receiving application. (Inherited from MsmqBindingElementBase.)
Public propertyMsmqTransportSecurityGets the MsmqTransportSecurity that is associated with this binding element. (Inherited from MsmqBindingElementBase.)
Public propertyQueueTransferProtocolGets or sets an enumeration value that indicates the queued communication channel transport that this binding uses.
Public propertyReceiveContextEnabledGets or sets a value that indicates whether the receive context behavior is requested. (Inherited from MsmqBindingElementBase.)
Public propertyReceiveErrorHandlingGets or sets an enumeration value that specifies how poison and other messages that cannot be dispatched are handled. (Inherited from MsmqBindingElementBase.)
Public propertyReceiveRetryCountGets or sets the maximum number of times the queue manager should attempt to send a message before transferring it to the retry queue. (Inherited from MsmqBindingElementBase.)
Public propertyRetryCycleDelayGets or sets a value that specifies how long to wait before attempting another retry cycle when attempting to deliver a message that could not be delivered. (Inherited from MsmqBindingElementBase.)
Public propertySchemeReturns a String that contains the addressing scheme that is used by this transport binding element. (Overrides TransportBindingElement.Scheme.)
Public propertyTimeToLiveGets or sets a value that specifies how long messages are valid. When this time has elapsed the message is placed in a dead-letter queue depending on the DeadLetterQueue setting. (Inherited from MsmqBindingElementBase.)
Public propertyTransactedReceiveEnabledGets a value that specifies whether a transaction is required to receive messages with this binding. (Inherited from MsmqBindingElementBase.)
Public propertyUseActiveDirectoryReturns a Boolean value that indicates whether queue addresses should be converted using Active Directory.
Public propertyUseMsmqTracingGets or sets a value that enables or disables the Message Queuing (MSMQ) built-in message tracing facility. (Inherited from MsmqBindingElementBase.)
Public propertyUseSourceJournalGets or sets a value that indicates whether copies of messages processed by this binding should be stored in the source journal queue. (Inherited from MsmqBindingElementBase.)
Public propertyValidityDurationGets or sets a value that specifies the duration a message will be locked by the receive context feature. (Inherited from MsmqBindingElementBase.)

Public methodBuildChannelFactory<TChannel>Builds a channel factory using the context provided. (Overrides BindingElement.BuildChannelFactory<TChannel>(BindingContext).)
Public methodBuildChannelListener<TChannel>Builds a channel listener using the context provided. (Overrides BindingElement.BuildChannelListener<TChannel>(BindingContext).)
Public methodCanBuildChannelFactory<TChannel>Returns a Boolean value that indicates whether you can build a channel factory with the context provided. (Overrides BindingElement.CanBuildChannelFactory<TChannel>(BindingContext).)
Public methodCanBuildChannelListener<TChannel>Returns a Boolean value that indicates whether you can build a channel listener with the context provided. (Overrides BindingElement.CanBuildChannelListener<TChannel>(BindingContext).)
Public methodCloneReturns a clone of the binding element. (Overrides BindingElement.Clone().)
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetProperty<T>When overridden in a derived class, retrieves a specified type of object for the binding context provided. (Inherited from MsmqBindingElementBase.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Explicit interface implemetationPrivate methodIPolicyExportExtension.ExportPolicyExports custom policy assertions about bindings. (Inherited from MsmqBindingElementBase.)
Explicit interface implemetationPrivate methodIWsdlExportExtension.ExportContractWrites custom Web Services Description Language (WSDL) elements into the generated WSDL for a contract. (Inherited from MsmqBindingElementBase.)
Explicit interface implemetationPrivate methodIWsdlExportExtension.ExportEndpointWrites custom Web Services Description Language (WSDL) elements into the generated WSDL for an endpoint. (Inherited from MsmqBindingElementBase.)

The MsmqTransportBindingElement enables the user to set the properties of the queued communication channel. The queued communication channel uses Message Queuing for its transport.

This binding element is the default binding element used by the Message Queuing standard binding (NetMsmqBinding).

string queueName = @".\private$\ServiceModelSamples";

if (!MessageQueue.Exists(queueName))
    MessageQueue.Create(queueName, true);

using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
    BinaryMessageEncodingBindingElement encodingBindingElement = new BinaryMessageEncodingBindingElement();
    MsmqTransportBindingElement transportBindingElement = new MsmqTransportBindingElement();
    CustomBinding binding = new CustomBinding(encodingBindingElement, transportBindingElement);



    // The service can now be accessed.
    Console.WriteLine("The service is ready.");
    Console.WriteLine("Press <ENTER> to terminate service.");

    // Close the ServiceHost to shutdown the service.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.