MsmqIntegrationBindingElement Class
.NET Framework 3.0
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.
Namespace: System.ServiceModel.MsmqIntegration
Assembly: System.ServiceModel (in system.servicemodel.dll)
Assembly: System.ServiceModel (in system.servicemodel.dll)
// 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"); serviceHost.Open(); // The service can now be accessed. Console.WriteLine("The service is ready."); Console.WriteLine("Press <ENTER> to terminate service."); Console.ReadLine(); }
System.Object
System.ServiceModel.Channels.BindingElement
System.ServiceModel.Channels.TransportBindingElement
System.ServiceModel.Channels.MsmqBindingElementBase
System.ServiceModel.MsmqIntegration.MsmqIntegrationBindingElement
System.ServiceModel.Channels.BindingElement
System.ServiceModel.Channels.TransportBindingElement
System.ServiceModel.Channels.MsmqBindingElementBase
System.ServiceModel.MsmqIntegration.MsmqIntegrationBindingElement
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: