다음을 통해 공유


SoapHeaderAttribute.Direction 속성

정의

해당 SOAP 헤더가 XML Web services를 위한 것인지 아니면 XML Web services 클라이언트를 위한 것인지 아니면 둘 모두를 위한 것인지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property System::Web::Services::Protocols::SoapHeaderDirection Direction { System::Web::Services::Protocols::SoapHeaderDirection get(); void set(System::Web::Services::Protocols::SoapHeaderDirection value); };
public System.Web.Services.Protocols.SoapHeaderDirection Direction { get; set; }
member this.Direction : System.Web.Services.Protocols.SoapHeaderDirection with get, set
Public Property Direction As SoapHeaderDirection

속성 값

SoapHeaderDirection

SOAP 헤더의 의도된 수신자입니다. 기본값은 In이며, 이 값은 의도된 수신자가 XML Web services임을 의미합니다.

예제

다음 MyWebService XML 웹 서비스는 형식 MyHeader중 하나를 SoapHeader 정의합니다. XML 웹 서비스 메서드는 Hello XML 웹 서비스 메서드를 호출하기 위해 XML 웹 서비스 메서드 및 클라이언트로 전송해야 하는 것을 지정 MyHeader 합니다.

#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(){}

};
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() {
    }
}
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


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

적용 대상