SoapHeaderAttribute(String) 생성자

정의

SOAP 헤더 내용을 나타내는 XML Web services 클래스의 멤버를 설정하여 SoapHeaderAttribute 클래스의 새 인스턴스를 초기화합니다.

public:
 SoapHeaderAttribute(System::String ^ memberName);
public SoapHeaderAttribute (string memberName);
new System.Web.Services.Protocols.SoapHeaderAttribute : string -> System.Web.Services.Protocols.SoapHeaderAttribute
Public Sub New (memberName As String)

매개 변수

memberName
String

SOAP 헤더 내용을 나타내는 XML Web services 클래스의 멤버로, MemberName 속성은 이 매개 변수의 값으로 설정됩니다.

예제

다음 MyWebService XML 웹 서비스는 형식 MyHeader중 하나를 SoapHeader 정의합니다. XML Web services 메서드는 Hello XML 웹 서비스 메서드에 전달된 SOAP 헤더의 MyHeader 콘텐츠를 받을 속성으로 MemberName 멤버를 지정 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

설명

XML 웹 서비스 클라이언트 또는 XML 웹 서비스는 XML 웹 서비스 클래스의 XML 웹 서비스 메서드 또는 프록시 클래스의 해당 메서드에 적용하여 SoapHeaderAttribute 특정 XML 웹 서비스 메서드에 대해 처리하려는 SOAP 헤더를 지정할 수 있습니다. XML 웹 서비스 메서드가 SOAP 헤더의 내용을 수신하기 위해 멤버가 파생된 XML 웹 서비스 클래스 Type 에 추가됩니다 SoapHeader. 마찬가지로 XML 웹 서비스 클라이언트에서 파생 되는 프록시 클래스에 멤버를 추가 합니다 SoapHeader. 이 Type 파생 SoapHeader 은 SOAP 헤더의 내용을 나타내며 SOAP 헤더를 수신하려는 XML 웹 서비스 또는 XML 웹 서비스 클라이언트의 개발자가 만듭니다. 클래스가 만들어 SoapHeaderAttribute 지면 XML 웹 서비스 메서드 또는 XML 웹 서비스 클라이언트 프록시 클래스의 해당 메서드에 적용하여 이 생성자 또는 MemberName 속성에 대한 매개 변수가 있는 memberName SOAP 헤더 콘텐츠를 받을 멤버를 지정할 수 있습니다.

XML 웹 서비스 메서드는 XML 웹 서비스 클래스 또는 XML 웹 서비스 프록시 클래스에 여러 멤버를 추가하고 XML 웹 서비스 메서드에 여러 특성을 적용하여 여러 SoapHeaderAttribute SOAP 헤더를 받을 수 있습니다.

XML 웹 서비스가 작성될 SoapUnknownHeaderSoapHeader 때 알 수 없는 SOAP 헤더를 받고 처리하려면 멤버의 배열을 지정하거나 클래스의 배열을 지정 Type 합니다.

적용 대상