MsmqIntegrationBindingElement 类   
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
此绑定元素可用于使 Windows Communication Foundation (WCF) 应用程序发送消息到满足以下条件的现有 MSMQ 应用程序或接受来自这些应用程序的消息:或者使用 COM、MSMQ 本机 API,或者使用 System.Messaging 中的 API。 使用此类可以向基于 MSMQ 的消息应用程序发送消息,或从这些应用程序接收消息。
public ref class MsmqIntegrationBindingElement sealed : System::ServiceModel::Channels::MsmqBindingElementBase
	public sealed class MsmqIntegrationBindingElement : System.ServiceModel.Channels.MsmqBindingElementBase
	type MsmqIntegrationBindingElement = class
    inherit 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");
    serviceHost.Open();
    // The service can now be accessed.
    Console.WriteLine("The service is ready.");
    Console.WriteLine("Press <ENTER> to terminate service.");
    Console.ReadLine();
}
	构造函数
| MsmqIntegrationBindingElement() | 
		 初始化 MsmqIntegrationBindingElement 类的新实例。  | 
        	
属性
方法
| BuildChannelFactory<TChannel>(BindingContext) | 
		 使用提供的上下文生成通道工厂。  | 
        	
| BuildChannelListener<TChannel>(BindingContext) | 
		 使用提供的上下文生成通道侦听器。  | 
        	
| CanBuildChannelFactory<TChannel>(BindingContext) | 
		 返回一个值,该值指示是否能够使用提供的上下文生成通道工厂。  | 
        	
| CanBuildChannelListener<TChannel>(BindingContext) | 
		 返回一个值,该值指示是否能够使用提供的上下文生成通道侦听器。  | 
        	
| Clone() | 
		 返回绑定元素的复本。  | 
        	
| Equals(Object) | 
		 确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 作为默认哈希函数。 (继承自 Object) | 
        	
| GetProperty<T>(BindingContext) | 
		 从指定的   | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回表示当前对象的字符串。 (继承自 Object) | 
        	
显式接口实现
| IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) | 
		 导出有关绑定的自定义策略断言。 (继承自 MsmqBindingElementBase) | 
        	
| IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) | 
		 为协定将自定义 Web 服务描述语言 (WSDL) 元素写入到生成的 WSDL 中。 (继承自 MsmqBindingElementBase) | 
        	
| IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) | 
		 为终结点将自定义 Web 服务描述语言 (WSDL) 元素写入到生成的 WSDL 中。 (继承自 MsmqBindingElementBase) |