次の方法で共有


IBindingDeliveryCapabilities.AssuresOrderedDelivery プロパティ

定義

バインドが送信された順序でメッセージの配信の保証をサポートできるかどうかを示す値を取得します。

public:
 property bool AssuresOrderedDelivery { bool get(); };
public bool AssuresOrderedDelivery { get; }
member this.AssuresOrderedDelivery : bool
Public ReadOnly Property AssuresOrderedDelivery As Boolean

プロパティ値

true メッセージが送信された順序で配信する必要がある場合。 false、メッセージがこの順序で配信されない可能性がある場合。

次の例では、 CalculatorService が順序付けられたメッセージ配信で WSHttpBinding を使用する必要があります。 このバインディングでは、信頼できるセッションとキューへの配信は既定では使用されませんが、有効にできます。

<!-- Here is the configuration for a CalculatorService using a WSHttpBinding with ordered message delivery required. -->
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
   <system.serviceModel>
      <services>
         <service
             type="Microsoft.ServiceModel.Samples.CalculatorService">
            <!-- Use base address provided by host and a WSHttpBinding named "Binding1" -->
            <endpoint address=""
                      binding="wsHttpBinding"
                      bindingConfiguration="Binding1"
                      contract="Microsoft.ServiceModel.Samples.ICalculator" />
         </service>
      </services>

      <bindings>
         <wsHttpBinding>
            <binding name="Binding1">
               <!-- The next element enables a ReliableSession and required ordered delivery-->
      <reliableSession enabled="true" ordered="true"/>
      </binding>
         </wsHttpBinding>
      </bindings>

   </system.serviceModel>
</configuration>

// The CalculatorService configuration has enabled a reliable session
// with ordered delivery set to true. This means that the binding
// requirement for ordered delivery specified by the
// BindingRequirementsAttribute on the CalculatorService class
// implemented below will be satisfied by this WSHttpBinding.

using System;
using System.ServiceModel;

[ServiceContract]
interface ICalculatorService
{
  [OperationBehavior()]
  int Add(int a, int b);

  [OperationContract]
  int Subtract(int a, int b);
}

[BindingRequirements(
  QueuedDeliveryRequirements=RequirementsMode.Disallow,
  RequireOrderedDelivery=true
)]
class CalculatorService: ICalculatorService
{
  public int Add(int a, int b)
  {
    Console.WriteLine("Add called.");
    return a + b;
  }

  public int Subtract(int a, int b)
  {
    Console.WriteLine("Subtract called.");
    return a - b;
  }

  public int Multiply(int a, int b)
  {
    return a * b;
  }
}

注釈

この AssuresOrderedDelivery プロパティの値は、実行時にサービスの説明が読み込まれるときに、 RequireOrderedDelivery によって使用されます。 このチェックは、サービスに対して選択または作成されたバインディングによって、サービスの順序指定された配信要件が満たされているかどうかを判断するために行われます。

適用対象