NetMsmqBinding Class
Represents a queued binding that is suitable for cross-machine communication.
System.ServiceModel.Channels::Binding
System.ServiceModel::MsmqBindingBase
System.ServiceModel::NetMsmqBinding
Assembly: System.ServiceModel (in System.ServiceModel.dll)
The NetMsmqBinding type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | NetMsmqBinding() | Initializes a new instance of the NetMsmqBinding class. |
![]() | NetMsmqBinding(NetMsmqSecurityMode) | Initializes a new instance of the NetMsmqBinding class using the specified security mode. |
![]() | NetMsmqBinding(String) | Initializes a new instance of the NetMsmqBinding class from the settings of a specified configuration binding element. |
| Name | Description | |
|---|---|---|
![]() | CloseTimeout | Gets or sets the interval of time provided for a connection to close before the transport raises an exception. (Inherited from Binding.) |
![]() | CustomDeadLetterQueue | Gets or sets a URI that contains the location of the dead-letter queue for each application, where messages that have expired or that have failed transfer or delivery are placed. (Inherited from MsmqBindingBase.) |
![]() | DeadLetterQueue | Gets or sets an enumeration value that indicates the type of dead-letter queue to use. (Inherited from MsmqBindingBase.) |
![]() | Durable | Gets or sets a value that indicates whether the messages processed by this binding are durable or volatile. (Inherited from MsmqBindingBase.) |
![]() | EnvelopeVersion | Gets the version of SOAP that is used for messages processed by this binding. |
![]() | ExactlyOnce | Gets or sets a value that indicates whether messages processed by this binding are received exactly once. (Inherited from MsmqBindingBase.) |
![]() | MaxBufferPoolSize | Gets or sets the maximum amount of memory that is allocated for use by the message buffer manager that receives messages from the channel. |
![]() | MaxReceivedMessageSize | Gets or sets the maximum size for a message that is processed by this binding. (Inherited from MsmqBindingBase.) |
![]() | MaxRetryCycles | Gets or sets the maximum number of retry cycles to attempt delivery of messages to the receiving application. (Inherited from MsmqBindingBase.) |
![]() | MessageVersion | Gets the message version used by clients and services configured with the binding. (Inherited from Binding.) |
![]() | Name | Gets or sets the name of the binding. (Inherited from Binding.) |
![]() | Namespace | Gets or sets the XML namespace of the binding. (Inherited from Binding.) |
![]() | OpenTimeout | Gets or sets the interval of time provided for a connection to open before the transport raises an exception. (Inherited from Binding.) |
![]() | QueueTransferProtocol | Gets or sets an enumeration value that indicates the queued communication channel transport that this binding uses. |
![]() | ReaderQuotas | Gets or sets the XmlDictionaryReaderQuotas that is associated with this binding. |
![]() | ReceiveContextEnabled | Gets or sets whether the ability to handle competing queue consumers is enabled. (Inherited from MsmqBindingBase.) |
![]() | ReceiveErrorHandling | Gets or sets an enumeration value that specifies how poison messages are handled. (Inherited from MsmqBindingBase.) |
![]() | ReceiveRetryCount | Gets or sets the maximum number of immediate delivery attempts on a message that is read from the application queue. (Inherited from MsmqBindingBase.) |
![]() | ReceiveTimeout | Gets or sets the interval of time that a connection can remain inactive, during which no application messages are received, before it is dropped. (Inherited from Binding.) |
![]() | RetryCycleDelay | Gets or sets a value that indicates the time delay between retry cycles when attempting to deliver a message that cannot be delivered immediately. (Inherited from MsmqBindingBase.) |
![]() | Scheme | Returns the scheme for this binding. (Inherited from MsmqBindingBase.) |
![]() | Security | Gets or sets the NetMsmqSecurity that is associated with this binding. |
![]() | SendTimeout | Gets or sets the interval of time provided for a write operation to complete before the transport raises an exception. (Inherited from Binding.) |
![]() | TimeToLive | Gets or sets the interval of time that indicates how long the messages processed by this binding can be in the queue before they expire. (Inherited from MsmqBindingBase.) |
![]() | UseActiveDirectory | Gets or sets a value that indicates whether queue addresses should be converted using Active Directory. |
![]() | UseMsmqTracing | Gets or sets a value that indicates whether messages processed by this binding should be traced. (Inherited from MsmqBindingBase.) |
![]() | 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 MsmqBindingBase.) |
![]() | ValidityDuration | Gets or sets a value that specifies the duration a message will be locked by the receive context feature. (Inherited from MsmqBindingBase.) |
| Name | Description | |
|---|---|---|
![]() | BuildChannelFactory<TChannel>(BindingParameterCollection) | Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by a collection of binding parameters. (Inherited from Binding.) |
![]() | BuildChannelFactory<TChannel>(array<Object>) | Builds the channel factory stack on the client that creates a specified type of channel and that satisfies the features specified by an object array. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified by a collection of binding parameters. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(array<Object>) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, array<Object>) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, String, array<Object>) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, String, ListenUriMode, array<Object>) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection) | Builds the channel listener on the service that accepts a specified type of channel and that satisfies the features specified. (Inherited from Binding.) |
![]() | CanBuildChannelFactory<TChannel>(BindingParameterCollection) | Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the collection of binding parameters specified. (Inherited from Binding.) |
![]() | CanBuildChannelFactory<TChannel>(array<Object>) | Returns a value that indicates whether the current binding can build a channel factory stack on the client that satisfies the requirements specified by an object array. (Inherited from Binding.) |
![]() | CanBuildChannelListener<TChannel>(BindingParameterCollection) | Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the collection of binding parameters specified. (Inherited from Binding.) |
![]() | CanBuildChannelListener<TChannel>(array<Object>) | Returns a value that indicates whether the current binding can build a channel listener stack on the service that satisfies the criteria specified in an array of objects. (Inherited from Binding.) |
![]() | CreateBindingElements | Returns an ordered collection of binding elements contained in the current binding. (Overrides Binding::CreateBindingElements().) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetProperty<T> | Returns a typed object requested, if present, from the appropriate layer in the binding stack. (Inherited from Binding.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ShouldSerializeName | Returns whether the name of the binding should be serialized. (Inherited from Binding.) |
![]() | ShouldSerializeNamespace | Returns whether the namespace of the binding should be serialized. (Inherited from Binding.) |
![]() | ShouldSerializeReaderQuotas | Returns a value that indicates whether the ReaderQuotas property has changed from its default value and should be serialized. |
![]() | ShouldSerializeSecurity | Returns a value that indicates whether the Security property has changed from its default value and should be serialized. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
| Name | Description | |
|---|---|---|
![]() ![]() | IBindingRuntimePreferences::ReceiveSynchronously | Gets a value that indicates whether incoming requests can be handled more efficiently synchronously or asynchronously. (Inherited from MsmqBindingBase.) |
The NetMsmqBinding binding provides support for queuing by using Message Queuing (MSMQ) as a transport and enables support for loosely-coupled applications, failure isolation, load leveling and disconnected operations. For a discussion of these features, see Queues.
This is one of the system-provided bindings provided by . The recommended procedure is to define the binding using configuration values and not to use a code-based approach, except in certain advanced scenarios where configuration values must be set as a service is initialized.
The following example shows how to configure a service to use the NetMsmqBinding binding.
First, the configuration file.
<!-- This is the service config file -->
<configuration>
<appSettings>
<!-- use appSetting to configure MSMQ queue name -->
<add key="queueName" value=".\private$\ServiceModelSamples" />
<add key ="baseAddress" value="http://localhost:8000/queuedCalculator/defaultSample"/>
</appSettings>
<system.serviceModel>
<services>
<service
name="Microsoft.ServiceModel.Samples.CalculatorService"
behaviorConfiguration="CalculatorServiceBehavior">
<!-- Define NetMsmqEndpoint -->
<endpoint address="net.msmq://localhost/private/ServiceModelSamples"
binding="netMsmqBinding"
contract="Microsoft.ServiceModel.Samples.IQueueCalculator" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
Next, the actual service code.
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.

