DeliveryRequirementsAttribute DeliveryRequirementsAttribute DeliveryRequirementsAttribute DeliveryRequirementsAttribute Class

Definición

Especifica los requisitos de características que los enlaces deben proporcionar al servicio o implementación del cliente.Specifies the feature requirements that bindings must provide to the service or client implementation.

public ref class DeliveryRequirementsAttribute sealed : Attribute, System::ServiceModel::Description::IContractBehavior, System::ServiceModel::Description::IContractBehaviorAttribute
[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
    interface IContractBehaviorAttribute
Public NotInheritable Class DeliveryRequirementsAttribute
Inherits Attribute
Implements IContractBehavior, IContractBehaviorAttribute
Herencia
DeliveryRequirementsAttributeDeliveryRequirementsAttributeDeliveryRequirementsAttributeDeliveryRequirementsAttribute
Atributos
Implementaciones

Ejemplos

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
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

Use el DeliveryRequirementsAttribute para indicar a Windows Communication Foundation (WCF) para confirmar que el enlace proporciona las características necesarias para la implementación de servicio o cliente.Use the DeliveryRequirementsAttribute to instruct Windows Communication Foundation (WCF) to confirm that the binding provides the features required by the service or client implementation. Si un DeliveryRequirementsAttribute atributo se detecta cuando se carga desde un archivo de configuración de aplicación o se crea mediante programación en código una descripción del servicio, WCF valida el enlace configurado y admite todas las características que especifica el atributo.If a DeliveryRequirementsAttribute attribute is detected when a service description is loaded from an application configuration file or built programmatically in code, WCF validates the configured binding and supports all the features that the attribute specifies. Por ejemplo, su servicio puede requerir que los enlaces admitan la puesta en cola.For example, your service may require the bindings to support queuing. Uso de DeliveryRequirementsAttribute permite que WCF confirmar que se cumplen los requisitos siguientes:Using DeliveryRequirementsAttribute allows WCF to confirm that the following requirements are met:

El atributo DeliveryRequirementsAttribute se aplica a una clase, que puede implementar un número ilimitado de interfaces de contrato de servicio.The DeliveryRequirementsAttribute attribute is applied to a class, which can implement any number of service contract interfaces. DeliveryRequirementsAttribute se puede aplicar a todos los contratos implementados por la clase o solo a uno de ellos.DeliveryRequirementsAttribute can be applied to all the contracts the class implements or to only one of them. El atributo se puede aplicar a más de una clase a la vez.The attribute can be applied to a class more than once.

Constructores

DeliveryRequirementsAttribute() DeliveryRequirementsAttribute() DeliveryRequirementsAttribute() DeliveryRequirementsAttribute()

Inicializa una nueva instancia de la clase DeliveryRequirementsAttribute.Initializes a new instance of the DeliveryRequirementsAttribute class.

Propiedades

QueuedDeliveryRequirements QueuedDeliveryRequirements QueuedDeliveryRequirements QueuedDeliveryRequirements

Especifica si el enlace de un servicio debe admitir contratos en cola.Specifies whether the binding for a service must support queued contracts.

RequireOrderedDelivery RequireOrderedDelivery RequireOrderedDelivery RequireOrderedDelivery

Especifica si el enlace debe admitir mensajes ordenados.Specifies whether the binding must support ordered messages.

TargetContract TargetContract TargetContract TargetContract

Obtiene o establece el tipo al que se aplica.Gets or sets the type to which it applies.

TypeId TypeId TypeId TypeId

Cuando se implementa en una clase derivada, obtiene un identificador único para este Attribute.When implemented in a derived class, gets a unique identifier for this Attribute.

(Inherited from Attribute)

Implementaciones de interfaz explícitas

IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection)

Implementa el método IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) para adjuntar correctamente parámetros de enlace.Implements the IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) method to attach binding parameters correctly.

IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime)

Implementación del método IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) para la compatibilidad de cliente.Implementation of the IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) method for client support.

IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime)

Implementación del método ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) que habilita la compatibilidad con respecto al servicio.Implementation of the ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) method that enables service support.

IContractBehavior.Validate(ContractDescription, ServiceEndpoint) IContractBehavior.Validate(ContractDescription, ServiceEndpoint) IContractBehavior.Validate(ContractDescription, ServiceEndpoint) IContractBehavior.Validate(ContractDescription, ServiceEndpoint)

Implementa el método IContractBehavior.Validate(ContractDescription, ServiceEndpoint) para habilitar la compatibilidad con respecto a la validación.Implements the IContractBehavior.Validate(ContractDescription, ServiceEndpoint) method to enable validation support.

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

Asigna un conjunto de nombres a un conjunto correspondiente de identificadores de envío.Maps a set of names to a corresponding set of dispatch identifiers.

(Inherited from Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Obtiene la información de tipos de un objeto, que puede utilizarse para obtener la información de tipos de una interfaz.Retrieves the type information for an object, which can be used to get the type information for an interface.

(Inherited from Attribute)
_Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32) _Attribute.GetTypeInfoCount(UInt32)

Recupera el número de interfaces de información de tipo que proporciona un objeto (0 ó 1).Retrieves the number of type information interfaces that an object provides (either 0 or 1).

(Inherited from Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Proporciona acceso a las propiedades y los métodos expuestos por un objeto.Provides access to properties and methods exposed by an object.

(Inherited from Attribute)

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Devuelve un valor que indica si esta instancia es igual que un objeto especificado.Returns a value that indicates whether this instance is equal to a specified object.

(Inherited from Attribute)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Devuelve el código hash de esta instancia.Returns the hash code for this instance.

(Inherited from Attribute)
GetType() GetType() GetType() GetType()

Obtiene el Type de la instancia actual.Gets the Type of the current instance.

(Inherited from Object)
IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute() IsDefaultAttribute()

Si se reemplaza en una clase derivada, indica si el valor de esta instancia es el valor predeterminado de la clase derivada.When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.

(Inherited from Attribute)
Match(Object) Match(Object) Match(Object) Match(Object)

Cuando se invalida en una clase derivada, devuelve un valor que indica si esta instancia es igual a un objeto especificado.When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.

(Inherited from Attribute)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Crea una copia superficial del objeto Object actual.Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Devuelve una cadena que representa el objeto actual.Returns a string that represents the current object.

(Inherited from Object)

Se aplica a