MsmqIntegrationBindingElement 類別

定義

這個繫結項目可用於讓 Windows Communication Foundation (WCF) 應用程式在現有的 MSMQ 應用程式中傳送和接收訊息,此 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 類別的新執行個體。

屬性

CustomDeadLetterQueue

取得或設定 Uri,這個項目會識別自訂的寄不出信件佇列,其中將會傳送無法傳遞的逾期訊息。

(繼承來源 MsmqBindingElementBase)
DeadLetterQueue

取得或設定這個繫結的 DeadLetterQueue 設定。

(繼承來源 MsmqBindingElementBase)
Durable

取得或設定值,這個值會指定使用這個繫結傳送的訊息是否具有永久性或變動性。

(繼承來源 MsmqBindingElementBase)
ExactlyOnce

取得或設定值,這個值會指定使用這個繫結傳送的訊息是否將具有正好一次的保證。

(繼承來源 MsmqBindingElementBase)
ManualAddressing

取得或設定值,這個值會指出是否需要訊息的手動定址。

(繼承來源 TransportBindingElement)
MaxBufferPoolSize

取得或設定傳輸所使用之任何緩衝區集區的大小上限 (以位元組為單位)。

(繼承來源 TransportBindingElement)
MaxReceivedMessageSize

取得或設定可接收之可允許的訊息大小上限 (以位元組為單位)。

(繼承來源 TransportBindingElement)
MaxRetryCycles

取得或設定嘗試傳遞訊息至接收應用程式的重試循環次數上限。

(繼承來源 MsmqBindingElementBase)
MsmqTransportSecurity

取得與此繫結項目相關聯的 MsmqTransportSecurity

(繼承來源 MsmqBindingElementBase)
ReceiveContextEnabled

取得或設定值,這個值表示是否已要求接收內容行為。

(繼承來源 MsmqBindingElementBase)
ReceiveErrorHandling

取得或設定列舉值,這個值會指定如何處理有害和其他不可分派的訊息。

(繼承來源 MsmqBindingElementBase)
ReceiveRetryCount

取得或設定佇列管理員在傳送訊息至重試佇列之前,應嘗試傳送的次數上限。

(繼承來源 MsmqBindingElementBase)
RetryCycleDelay

取得或設定值,這個值會指定當嘗試傳遞無法傳遞的訊息時,在嘗試另一次重試循環之前要等待的時間長度。

(繼承來源 MsmqBindingElementBase)
Scheme

取得 String,其中包含繫結項目使用的配置。

SerializationFormat

取得或設定要在序列化 MSMQ 訊息時使用的 MsmqMessageSerializationFormat

TargetSerializationTypes

取得或設定 Type 物件的陣列,其中包含訊息還原序列化後應該產生的類型。

TimeToLive

取得或設定指定訊息有效時間長度的值。 經過這個時間之後,訊息就會根據 DeadLetterQueue 設定放在寄不出的信件佇列中。

(繼承來源 MsmqBindingElementBase)
TransactedReceiveEnabled

取得值,這個值指定這個繫結程序是否需要異動來接收訊息。

(繼承來源 MsmqBindingElementBase)
UseMsmqTracing

取得或設定值,這個值會啟用或停用訊息佇列 (MSMQ) 內建訊息追蹤工具。

(繼承來源 MsmqBindingElementBase)
UseSourceJournal

取得或設定值,此值會指出是否要將此繫結處理之訊息的複本儲存在來源日誌佇列。

(繼承來源 MsmqBindingElementBase)
ValidityDuration

取得或設定值,這個值會指定接收內容功能鎖定訊息的持續期間。

(繼承來源 MsmqBindingElementBase)

方法

BuildChannelFactory<TChannel>(BindingContext)

使用提供的內容建置通道處理站。

BuildChannelListener<TChannel>(BindingContext)

使用提供的內容建置通道接聽程式。

CanBuildChannelFactory<TChannel>(BindingContext)

傳回值,這個值表示您是否可以使用所提供的內容來建置通道處理站。

CanBuildChannelListener<TChannel>(BindingContext)

傳回值,這個值表示您是否可以使用所提供的內容來建置通道接聽程式。

Clone()

傳回繫結項目的複製品 (Clone)。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetProperty<T>(BindingContext)

從指定的 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)

適用於