MsmqTransportBindingElement 類別

定義

表示用來為 Windows Communication Foundation (WCF) 服務指定佇列通訊屬性的繫結項目 (該服務會使用原生 Message Queuing (MSMQ) 通訊協定)。

public ref class MsmqTransportBindingElement sealed : System::ServiceModel::Channels::MsmqBindingElementBase
public sealed class MsmqTransportBindingElement : System.ServiceModel.Channels.MsmqBindingElementBase
type MsmqTransportBindingElement = class
    inherit MsmqBindingElementBase
Public NotInheritable Class MsmqTransportBindingElement
Inherits MsmqBindingElementBase
繼承

範例

string queueName = @".\private$\ServiceModelSamples";

if (!MessageQueue.Exists(queueName))
    MessageQueue.Create(queueName, true);

using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService)))
{
    BinaryMessageEncodingBindingElement encodingBindingElement = new BinaryMessageEncodingBindingElement();
    MsmqTransportBindingElement transportBindingElement = new MsmqTransportBindingElement();
    CustomBinding binding = new CustomBinding(encodingBindingElement, transportBindingElement);

    serviceHost.AddServiceEndpoint(
        typeof(IQueueCalculator),
        binding,
        "net.msmq://localhost/private/ServiceModelSamples");

    serviceHost.Open();

    // The service can now be accessed.
    Console.WriteLine("The service is ready.");
    Console.WriteLine("Press <ENTER> to terminate service.");
    Console.WriteLine();
    Console.ReadLine();

    // Close the ServiceHost to shutdown the service.
    serviceHost.Close();

備註

MsmqTransportBindingElement 可讓使用者設定佇列通訊通道的屬性。 佇列通訊通道的傳輸中會使用訊息佇列。

這個繫結項目是訊息佇列標準繫結 (NetMsmqBinding) 所使用的預設繫結項目。

建構函式

MsmqTransportBindingElement()

初始化 MsmqTransportBindingElement 類別的新執行個體。

屬性

CustomDeadLetterQueue

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

(繼承來源 MsmqBindingElementBase)
DeadLetterQueue

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

(繼承來源 MsmqBindingElementBase)
Durable

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

(繼承來源 MsmqBindingElementBase)
ExactlyOnce

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

(繼承來源 MsmqBindingElementBase)
ManualAddressing

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

(繼承來源 TransportBindingElement)
MaxBufferPoolSize

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

(繼承來源 TransportBindingElement)
MaxPoolSize

取得或設定整數,這個整數會指定包含內部訊息佇列 (MSMQ) 訊息物件之集區大小的上限。

MaxReceivedMessageSize

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

(繼承來源 TransportBindingElement)
MaxRetryCycles

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

(繼承來源 MsmqBindingElementBase)
MsmqTransportSecurity

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

(繼承來源 MsmqBindingElementBase)
QueueTransferProtocol

取得或設定列舉值,這個值表示此繫結所使用的佇列通訊通道傳輸。

ReceiveContextEnabled

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

(繼承來源 MsmqBindingElementBase)
ReceiveErrorHandling

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

(繼承來源 MsmqBindingElementBase)
ReceiveRetryCount

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

(繼承來源 MsmqBindingElementBase)
RetryCycleDelay

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

(繼承來源 MsmqBindingElementBase)
Scheme

傳回 String,其中包含這個傳輸繫結項目所使用的定址配置。

TimeToLive

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

(繼承來源 MsmqBindingElementBase)
TransactedReceiveEnabled

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

(繼承來源 MsmqBindingElementBase)
UseActiveDirectory

傳回布林值,這個值會指出是否應該使用 Active Directory 來轉換佇列位址。

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)

在衍生類別中覆寫時,為提供的繫結內容擷取指定型別的物件。

(繼承來源 MsmqBindingElementBase)
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)

適用於