MsmqIntegrationBindingElement MsmqIntegrationBindingElement 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 ref class MsmqIntegrationBindingElement sealed : System::ServiceModel::Channels::MsmqBindingElementBase
public sealed class MsmqIntegrationBindingElement : System.ServiceModel.Channels.MsmqBindingElementBase
Public NotInheritable Class MsmqIntegrationBindingElement
Inherits 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.");


MsmqIntegrationBindingElement() MsmqIntegrationBindingElement() MsmqIntegrationBindingElement()

Initializes a new instance of the MsmqIntegrationBindingElement class.


CustomDeadLetterQueue CustomDeadLetterQueue CustomDeadLetterQueue

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)
DeadLetterQueue DeadLetterQueue DeadLetterQueue

Gets or sets the DeadLetterQueue setting for this binding.

(Inherited from MsmqBindingElementBase)
Durable Durable Durable

Gets or sets a value that specifies whether messages sent with this binding are durable or volatile.

(Inherited from MsmqBindingElementBase)
ExactlyOnce ExactlyOnce ExactlyOnce

Gets or sets a value that specifies whether messages sent with this binding have exactly once assurances.

(Inherited from MsmqBindingElementBase)
ManualAddressing ManualAddressing ManualAddressing

Gets or sets a value that indicates whether manual addressing of the message is required.

(Inherited from TransportBindingElement)
MaxBufferPoolSize MaxBufferPoolSize MaxBufferPoolSize

Gets or sets the maximum size, in bytes, of any buffer pools used by the transport.

(Inherited from TransportBindingElement)
MaxReceivedMessageSize MaxReceivedMessageSize MaxReceivedMessageSize

Gets and sets the maximum allowable message size, in bytes, that can be received.

(Inherited from TransportBindingElement)
MaxRetryCycles MaxRetryCycles MaxRetryCycles

Gets or sets the maximum number of retry cycles to attempt delivery of messages to the receiving application.

(Inherited from MsmqBindingElementBase)
MsmqTransportSecurity MsmqTransportSecurity MsmqTransportSecurity

Gets the MsmqTransportSecurity that is associated with this binding element.

(Inherited from MsmqBindingElementBase)
ReceiveContextEnabled ReceiveContextEnabled ReceiveContextEnabled

Gets or sets a value that indicates whether the receive context behavior is requested.

(Inherited from MsmqBindingElementBase)
ReceiveErrorHandling ReceiveErrorHandling ReceiveErrorHandling

Gets or sets an enumeration value that specifies how poison and other messages that cannot be dispatched are handled.

(Inherited from MsmqBindingElementBase)
ReceiveRetryCount ReceiveRetryCount ReceiveRetryCount

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)
RetryCycleDelay RetryCycleDelay RetryCycleDelay

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)
Scheme Scheme Scheme

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

SerializationFormat SerializationFormat SerializationFormat

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

TargetSerializationTypes TargetSerializationTypes TargetSerializationTypes

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

TimeToLive TimeToLive TimeToLive

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)
TransactedReceiveEnabled TransactedReceiveEnabled TransactedReceiveEnabled

Gets a value that specifies whether a transaction is required to receive messages with this binding.

(Inherited from MsmqBindingElementBase)
UseMsmqTracing UseMsmqTracing UseMsmqTracing

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

(Inherited from MsmqBindingElementBase)
UseSourceJournal UseSourceJournal UseSourceJournal

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)
ValidityDuration ValidityDuration ValidityDuration

Gets or sets a value that specifies the duration a message will be locked by the receive context feature.

(Inherited from MsmqBindingElementBase)


BuildChannelFactory<TChannel>(BindingContext) BuildChannelFactory<TChannel>(BindingContext) BuildChannelFactory<TChannel>(BindingContext)

Builds a channel factory using the context provided.

BuildChannelListener<TChannel>(BindingContext) BuildChannelListener<TChannel>(BindingContext) BuildChannelListener<TChannel>(BindingContext)

Builds a channel listener using the context provided.

CanBuildChannelFactory<TChannel>(BindingContext) CanBuildChannelFactory<TChannel>(BindingContext) CanBuildChannelFactory<TChannel>(BindingContext)

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

CanBuildChannelListener<TChannel>(BindingContext) CanBuildChannelListener<TChannel>(BindingContext) CanBuildChannelListener<TChannel>(BindingContext)

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

Clone() Clone() Clone()

Returns a clone of the binding element.

Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetProperty<T>(BindingContext) GetProperty<T>(BindingContext) GetProperty<T>(BindingContext)

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

GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

Exports custom policy assertions about bindings.

(Inherited from MsmqBindingElementBase)
IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext)

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

(Inherited from MsmqBindingElementBase)
IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext)

Writes custom Web Services Description Language (WSDL) elements into the generated WSDL for an endpoint.

(Inherited from MsmqBindingElementBase)

Applies to