MsmqTransportBindingElement Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Represents the binding element used to specify the queuing communication properties for a Windows Communication Foundation (WCF) 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

NameDescription
System_CAPS_pubmethodMsmqTransportBindingElement()

Initializes a new instance of the MsmqTransportBindingElement class.

NameDescription
System_CAPS_pubpropertyCustomDeadLetterQueue

Gets 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.)

System_CAPS_pubpropertyDeadLetterQueue

Gets or sets the DeadLetterQueue setting for this binding.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyDurable

Gets or sets a value that specifies whether messages sent with this binding are durable or volatile.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyExactlyOnce

Gets or sets a value that specifies whether messages sent with this binding have exactly once assurances.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyManualAddressing

Gets or sets a value that indicates whether manual addressing of the message is required.(Inherited from TransportBindingElement.)

System_CAPS_pubpropertyMaxBufferPoolSize

Gets or sets the maximum size, in bytes, of any buffer pools used by the transport. (Inherited from TransportBindingElement.)

System_CAPS_pubpropertyMaxPoolSize

Gets or sets an integer that specifies the maximum size of the pool that contains internal Message Queuing (MSMQ) message objects.

System_CAPS_pubpropertyMaxReceivedMessageSize

Gets and sets the maximum allowable message size, in bytes, that can be received.(Inherited from TransportBindingElement.)

System_CAPS_pubpropertyMaxRetryCycles

Gets or sets the maximum number of retry cycles to attempt delivery of messages to the receiving application.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyMsmqTransportSecurity

Gets the MsmqTransportSecurity that is associated with this binding element.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyQueueTransferProtocol

Gets or sets an enumeration value that indicates the queued communication channel transport that this binding uses.

System_CAPS_pubpropertyReceiveContextEnabled

Gets or sets a value that indicates whether the receive context behavior is requested.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyReceiveErrorHandling

Gets or sets an enumeration value that specifies how poison and other messages that cannot be dispatched are handled.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyReceiveRetryCount

Gets 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.)

System_CAPS_pubpropertyRetryCycleDelay

Gets 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.)

System_CAPS_pubpropertyScheme

Returns a String that contains the addressing scheme that is used by this transport binding element.(Overrides TransportBindingElement.Scheme.)

System_CAPS_pubpropertyTimeToLive

Gets 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.)

System_CAPS_pubpropertyTransactedReceiveEnabled

Gets a value that specifies whether a transaction is required to receive messages with this binding.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyUseActiveDirectory

Returns a Boolean value that indicates whether queue addresses should be converted using Active Directory.

System_CAPS_pubpropertyUseMsmqTracing

Gets or sets a value that enables or disables the Message Queuing (MSMQ) built-in message tracing facility.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubpropertyUseSourceJournal

Gets 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.)

System_CAPS_pubpropertyValidityDuration

Gets or sets a value that specifies the duration a message will be locked by the receive context feature. (Inherited from MsmqBindingElementBase.)

NameDescription
System_CAPS_pubmethodBuildChannelFactory<TChannel>(BindingContext)

Builds a channel factory using the context provided.(Overrides BindingElement.BuildChannelFactory<TChannel>(BindingContext).)

System_CAPS_pubmethodBuildChannelListener<TChannel>(BindingContext)

Builds a channel listener using the context provided.(Overrides BindingElement.BuildChannelListener<TChannel>(BindingContext).)

System_CAPS_pubmethodCanBuildChannelFactory<TChannel>(BindingContext)

Returns a Boolean value that indicates whether you can build a channel factory with the context provided.(Overrides BindingElement.CanBuildChannelFactory<TChannel>(BindingContext).)

System_CAPS_pubmethodCanBuildChannelListener<TChannel>(BindingContext)

Returns a Boolean value that indicates whether you can build a channel listener with the context provided.(Overrides BindingElement.CanBuildChannelListener<TChannel>(BindingContext).)

System_CAPS_pubmethodClone()

Returns a clone of the binding element.(Overrides BindingElement.Clone().)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetProperty<T>(BindingContext)

When overridden in a derived class, retrieves a specified type of object for the binding context provided.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

Exports custom policy assertions about bindings.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext)

Writes custom Web Services Description Language (WSDL) elements into the generated WSDL for a contract.(Inherited from MsmqBindingElementBase.)

System_CAPS_pubinterfaceSystem_CAPS_privmethodIWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext)

Writes 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);

    serviceHost.AddServiceEndpoint(
        typeof(IQueueCalculator),
        binding,
        "net.msmq://localhost/private/ServiceModelSamples");

    serviceHost.Open();

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

    // Close the ServiceHost to shutdown the service.
    serviceHost.Close();

.NET Framework
Available since 3.0

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

Return to top
Show: