MsmqIntegrationBindingElement Class


This binding element can be used to enable Windows Communication Foundation (WCF) applications to send messages to and receive messages from existing MSMQ applications that use either COM, MSMQ native APIs, or the APIs in System.Messaging. Use this class to send and receive messages from MSMQ-based messaging applications.

public sealed class MsmqIntegrationBindingElement : System.ServiceModel.Channels.MsmqBindingElementBase


// Get MSMQ queue name from appsettings in configuration.
string queueName = @".\private$\Orders";

// Create the transacted MSMQ queue if necessary.
if (!MessageQueue.Exists(queueName))
    MessageQueue.Create(queueName, true);

// Create a ServiceHost for the CalculatorService type.
using (ServiceHost serviceHost = new ServiceHost(typeof(OrderProcessorService)))
    MsmqIntegrationBindingElement msmqBindingElement = new MsmqIntegrationBindingElement();

    String strScheme = msmqBindingElement.Scheme;
    Console.WriteLine("Scheme = " + strScheme);

    Type[] types = msmqBindingElement.TargetSerializationTypes;
    CustomBinding binding = new CustomBinding(msmqBindingElement);

    serviceHost.AddServiceEndpoint(typeof(IOrderProcessor), binding, @"msmq.formatname:DIRECT=OS:.\private$\Orders");


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



Initializes a new instance of the MsmqIntegrationBindingElement class.


CustomDeadLetterQueue Inherited from MsmqBindingElementBase
DeadLetterQueue Inherited from MsmqBindingElementBase
Durable Inherited from MsmqBindingElementBase
ExactlyOnce Inherited from MsmqBindingElementBase
ManualAddressing Inherited from TransportBindingElement
MaxBufferPoolSize Inherited from TransportBindingElement
MaxReceivedMessageSize Inherited from TransportBindingElement
MaxRetryCycles Inherited from MsmqBindingElementBase
MsmqTransportSecurity Inherited from MsmqBindingElementBase
ReceiveContextEnabled Inherited from MsmqBindingElementBase
ReceiveErrorHandling Inherited from MsmqBindingElementBase
ReceiveRetryCount Inherited from MsmqBindingElementBase
RetryCycleDelay Inherited from MsmqBindingElementBase

Gets a String that contains the scheme used by the binding element.


Gets or sets the MsmqMessageSerializationFormat to be used when serializing MSMQ messages.


Gets or sets an array of Type objects that contain the types to which messages should be deserialized.

TimeToLive Inherited from MsmqBindingElementBase
TransactedReceiveEnabled Inherited from MsmqBindingElementBase
UseMsmqTracing Inherited from MsmqBindingElementBase
UseSourceJournal Inherited from MsmqBindingElementBase
ValidityDuration Inherited from MsmqBindingElementBase



Builds a channel factory using the context provided.


Builds a channel listener using the context provided.


Returns a value that indicates whether you can build a channel factory with the context provided.


Returns a value that indicates whether you can build a channel listener with the context provided.


Returns a clone of the binding element.

Equals(Object) Inherited from Object
Equals(Object, Object) Inherited from Object
GetHashCode() Inherited from Object

Gets a property of the requested type from the specified BindingContext.

GetType() Inherited from Object
IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) Inherited from MsmqBindingElementBase
IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) Inherited from MsmqBindingElementBase
IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) Inherited from MsmqBindingElementBase
MemberwiseClone() Inherited from Object
ReferenceEquals(Object, Object) Inherited from Object
ToString() Inherited from Object

Applies to