DeliveryRequirementsAttribute クラス

定義

バインディングがサービスまたはクライアントの実装に対して提供する必要がある機能要件を指定します。

public ref class DeliveryRequirementsAttribute sealed : Attribute, System::ServiceModel::Description::IContractBehavior
public ref class DeliveryRequirementsAttribute sealed : Attribute, System::ServiceModel::Description::IContractBehavior, System::ServiceModel::Description::IContractBehaviorAttribute
public sealed class DeliveryRequirementsAttribute : Attribute, System.ServiceModel.Description.IContractBehavior
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true)]
public sealed class DeliveryRequirementsAttribute : Attribute, System.ServiceModel.Description.IContractBehavior, System.ServiceModel.Description.IContractBehaviorAttribute
type DeliveryRequirementsAttribute = class
    inherit Attribute
    interface IContractBehavior
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true)>]
type DeliveryRequirementsAttribute = class
    inherit Attribute
    interface IContractBehavior
    interface IContractBehaviorAttribute
Public NotInheritable Class DeliveryRequirementsAttribute
Inherits Attribute
Implements IContractBehavior
Public NotInheritable Class DeliveryRequirementsAttribute
Inherits Attribute
Implements IContractBehavior, IContractBehaviorAttribute
継承
DeliveryRequirementsAttribute
属性
実装

using System;
using System.ServiceModel;

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

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

[DeliveryRequirementsAttribute(
  QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.NotAllowed,
  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;
  }
}
Imports System.ServiceModel

<ServiceContract()> _
Public Interface ICalculatorService

    <OperationBehavior()> _
    Function Add(ByVal a As Integer, ByVal b As Integer) As Integer

    <OperationContract()> _
    Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
End Interface

<DeliveryRequirements( _
    QueuedDeliveryRequirements:=QueuedDeliveryRequirementsMode.NotAllowed, _
    RequireOrderedDelivery:=True _
)> _
Class CalculatorService
    Public Function add(ByVal a As Integer, ByVal b As Integer) As Integer
        Console.WriteLine("Add called")
        Return a + b
    End Function

    Public Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
        Console.WriteLine("Subtract called.")
        Return a - b
    End Function

    Public Function Multiply(ByVal a As Integer, ByVal b As Integer) As Integer
        Return a * b
    End Function
End Class

注釈

DeliveryRequirementsAttributeこれを使用して、Windows Communication Foundation (WCF) に指示し、バインディングがサービスまたはクライアントの実装に必要な機能を提供することを確認します。 DeliveryRequirementsAttributeサービスの説明がアプリケーション構成ファイルから読み込まれたり、コードでプログラムによってビルドされたりしたときに属性が検出された場合、WCF は構成済みのバインディングを検証し、属性が指定するすべての機能をサポートします。 たとえば、サービスでバインドにキューをサポートするように要求できます。 使用 DeliveryRequirementsAttribute すると、WCF は次の要件が満たされていることを確認できます。

  • QueuedDeliveryRequirements プロパティは、バインドが満たす必要のあるキューの要件を指定します。

  • RequireOrderedDelivery プロパティは、バインドが順序付けられたメッセージをサポートする必要があるかどうかを示します。

  • TargetContract プロパティは、要件を適用する型を示します。

DeliveryRequirementsAttribute 属性はクラスに適用され、任意の数のサービス コントラクト インターフェイスを実装できます。 DeliveryRequirementsAttribute は、クラスが実装するコントラクトのすべて、または 1 つだけに適用できます。 この属性は、クラスに対して複数回適用できます。

コンストラクター

DeliveryRequirementsAttribute()

DeliveryRequirementsAttribute クラスの新しいインスタンスを初期化します。

プロパティ

QueuedDeliveryRequirements

サービスのバインディングでキュー付きのコントラクトをサポートする必要があるかどうかを指定します。

RequireOrderedDelivery

バインディングで順序付きメッセージをサポートする必要があるかどうかを指定します。

TargetContract

型の適用先を取得または設定します。

TypeId

派生クラスで実装されると、この Attribute の一意の識別子を取得します。

(継承元 Attribute)

メソッド

Equals(Object)

このインスタンスが、指定されたオブジェクトと等価であるかどうかを示す値を返します。

(継承元 Attribute)
GetHashCode()

このインスタンスのハッシュ コードを返します。

(継承元 Attribute)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
IsDefaultAttribute()

派生クラスでオーバーライドされるとき、このインスタンスの値が派生クラスの既定値であるかどうかを示します。

(継承元 Attribute)
Match(Object)

派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンスが等しいかどうかを示す値を返します。

(継承元 Attribute)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

明示的なインターフェイスの実装

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

一連の名前を対応する一連のディスパッチ識別子に割り当てます。

(継承元 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

オブジェクトの型情報を取得します。この情報はインターフェイスの型情報の取得に使用できます。

(継承元 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

オブジェクトが提供する型情報インターフェイスの数 (0 または 1) を取得します。

(継承元 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

オブジェクトによって公開されたプロパティおよびメソッドへのアクセスを提供します。

(継承元 Attribute)
IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection)

IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) メソッドを実装して、バインド パラメーターを適切にアタッチします。

IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime)

クライアントをサポートするための IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) メソッドの実装です。

IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime)

サービスのサポートを有効にする ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) メソッドの実装です。

IContractBehavior.Validate(ContractDescription, ServiceEndpoint)

IContractBehavior.Validate(ContractDescription, ServiceEndpoint) メソッドを実装して、検証のサポートを有効にします。

適用対象