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)
Visual Basic (Declaración)
Public Property Direction As SoapHeaderDirection
Dim instance As SoapHeaderAttribute
Dim value As SoapHeaderDirection
value = instance.Direction
instance.Direction = value
public SoapHeaderDirection Direction { get; set; }
public:
property SoapHeaderDirection Direction {
SoapHeaderDirection get ();
void set (SoapHeaderDirection value);
}
/** @property */
public SoapHeaderDirection get_Direction()
/** @property */
public void set_Direction(SoapHeaderDirection value)
public function get Direction () : SoapHeaderDirection
public function set Direction (value : SoapHeaderDirection)
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.
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
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() {
}
}
#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(){}
};
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
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.
.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
Referencia