Biblioteca de clases de .NET Framework
SoapHeaderAttribute..::.Direction (Propiedad)

Actualización: noviembre 2007

Obtiene o establece si el encabezado SOAP está destinado al servicio Web XML, al cliente de servicios Web XML o a ambos.

Espacio de nombres:  System.Web.Services.Protocols
Ensamblado:  System.Web.Services (en System.Web.Services.dll)
Sintaxis

Visual Basic (Declaración)
Public Property Direction As SoapHeaderDirection
Visual Basic (Uso)
Dim instance As SoapHeaderAttribute
Dim value As SoapHeaderDirection

value = instance.Direction

instance.Direction = value
C#
public SoapHeaderDirection Direction { get; set; }
Visual C++
public:
property SoapHeaderDirection Direction {
    SoapHeaderDirection get ();
    void set (SoapHeaderDirection value);
}
J#
/** @property */
public SoapHeaderDirection get_Direction()
/** @property */
public  void set_Direction(SoapHeaderDirection value)
JScript
public function get Direction () : SoapHeaderDirection
public function set Direction (value : SoapHeaderDirection)

Valor de propiedad

Tipo: System.Web.Services.Protocols..::.SoapHeaderDirection
Destinatario correspondiente del encabezado SOAP. El valor predeterminado es In, que indica que el destinatario correspondiente es el servicio Web XML.
Ejemplos

El siguiente servicio Web XML MyWebService define un SoapHeader de tipo MyHeader. El método de servicios Web XML Hello especifica que el encabezado MyHeader debe enviarse al método de servicios Web XML y al cliente para llamar al método de servicios Web XML.

Visual Basic
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

' Define a SOAP header by deriving from the SoapHeader base class.
' The header contains just one string value.
Public Class MyHeader
   Inherits SoapHeader
   Public MyValue As String
End Class 'MyHeader


Public Class MyWebService
   ' Member variable to receive the contents of the MyHeader SOAP header.
   Public myHeader As MyHeader


   <WebMethod, _ 
    SoapHeader("myHeader", Direction := SoapHeaderDirection.InOut)> _
   Public Sub Hello()

   End Sub 'Hello
End Class 'MyWebService

C#
using System;
using System.Web.Services;
using System.Web.Services.Protocols;

// Define a SOAP header by deriving from the SoapHeader base class.
// The header contains just one string value.
public class MyHeader : SoapHeader {
    public string MyValue;
}

public class MyWebService {
    // Member variable to receive the contents of the MyHeader SOAP header.
    public MyHeader myHeader;

    [WebMethod]
    [SoapHeader("myHeader", Direction=SoapHeaderDirection.InOut)]
    public void Hello() {

    }
}
Visual C++
#using <System.EnterpriseServices.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Web::Services;
using namespace System::Web::Services::Protocols;

// Define a SOAP header by deriving from the SoapHeader base class.
// The header contains just one string value.
public ref class MyHeader: public SoapHeader
{
public:
   String^ MyValue;
};

public ref class MyWebService
{
public:

   // Member variable to receive the contents of the MyHeader SOAP header.
   MyHeader^ myHeader;

   [WebMethod]
   [SoapHeader("myHeader",Direction=SoapHeaderDirection::InOut)]
   void Hello(){}

};

J#
import System.*;
import System.Web.Services.*;
import System.Web.Services.Protocols.*;

// Define a SOAP header by deriving from the SoapHeader base class.
// The header contains just one string value.
public class MyHeader extends SoapHeader
{
    public String myValue;
} //MyHeader

public class MyWebService
{
    // Member variable to receive the contents of the MyHeader SOAP header.
    public MyHeader myHeader;

    /** @attribute WebMethod()
     */
    /** @attribute SoapHeader("myHeader", Direction = SoapHeaderDirection.InOut)
     */

    public void Hello()
    {
    } //Hello
} //MyWebService
Plataformas

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC

.NET Framework y .NET Compact Framework no admiten todas las versiones de cada plataforma. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.
Información de versión

.NET Framework

Compatible con: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Compatible con: 3.5, 2.0, 1.0
Vea también

Referencia

Etiquetas :


Page view tracker