Compartir a través de


DeliveryRequirementsAttribute.QueuedDeliveryRequirements Propiedad

Definición

Especifica si el enlace de un servicio debe admitir contratos en cola.

public:
 property System::ServiceModel::QueuedDeliveryRequirementsMode QueuedDeliveryRequirements { System::ServiceModel::QueuedDeliveryRequirementsMode get(); void set(System::ServiceModel::QueuedDeliveryRequirementsMode value); };
public System.ServiceModel.QueuedDeliveryRequirementsMode QueuedDeliveryRequirements { get; set; }
member this.QueuedDeliveryRequirements : System.ServiceModel.QueuedDeliveryRequirementsMode with get, set
Public Property QueuedDeliveryRequirements As QueuedDeliveryRequirementsMode

Valor de propiedad

QueuedDeliveryRequirementsMode

Uno de los valores de QueuedDeliveryRequirementsMode; el valor predeterminado es Allowed.

Excepciones

El valor no es uno de los valores de QueuedDeliveryRequirementsMode.

Ejemplos

En el ejemplo de código siguiente se usa el DeliveryRequirementsAttribute atributo para indicar a WCF que confirme en tiempo de ejecución que el enlace real no admite contratos en cola, sino que admite mensajes ordenados.

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

Comentarios

Required indica a WCF que confirme que el enlace admite la entrega en cola. El NotAllowed valor indica a WCF que confirme que el enlace no admite la entrega en cola.

Se aplica a