SoapExtensionAttribute 클래스

정의

파생 클래스에서 재정의된 경우 XML Web services 메서드와 함께 실행되도록 SOAP 확장을 지정합니다.

public ref class SoapExtensionAttribute abstract : Attribute
public abstract class SoapExtensionAttribute : Attribute
type SoapExtensionAttribute = class
    inherit Attribute
Public MustInherit Class SoapExtensionAttribute
Inherits Attribute
상속
SoapExtensionAttribute

예제

다음 TraceExtensionAttribute 클래스에서 파생 되며 SoapExtensionAttribute XML 웹 서비스 메서드나는 XML 웹 서비스 클라이언트 프록시 클래스의 메서드에 특성 적용을 지원 하도록 합니다. 중 하나를 적용할 때를 TraceExtension SOAP 확장 메서드를 사용 하 여 실행 합니다.

// Create a SoapExtensionAttribute for a SOAP extension that can be
// applied to an XML Web service method.

[AttributeUsage(AttributeTargets::Method)]
public ref class TraceExtensionAttribute: public SoapExtensionAttribute
{
private:
   String^ myFilename;
   int myPriority;

public:

   // Set the name of the log file were SOAP messages will be stored.
   TraceExtensionAttribute()
      : SoapExtensionAttribute()
   {
      myFilename = "C:\\logClient.txt";
   }

   property Type^ ExtensionType 
   {
      // Return the type of 'TraceExtension' class.
      virtual Type^ get() override
      {
         return TraceExtension::typeid;
      }
   }

   property int Priority 
   {
      // User can set priority of the 'SoapExtension'.
      virtual int get() override
      {
         return myPriority;
      }

      virtual void set( int value ) override
      {
         myPriority = value;
      }
   }

   property String^ Filename 
   {
      String^ get()
      {
         return myFilename;
      }

      void set( String^ value )
      {
         myFilename = value;
      }
   }
};
// Create a SoapExtensionAttribute for a SOAP extension that can be
// applied to an XML Web service method.
[AttributeUsage(AttributeTargets.Method)]
public class TraceExtensionAttribute : SoapExtensionAttribute {

    private string myFilename;
    private int myPriority;

    // Set the name of the log file were SOAP messages will be stored.
    public TraceExtensionAttribute() : base()
    {
        myFilename = "C:\\logClient.txt";
    }

    // Return the type of 'TraceExtension' class.
    public override Type ExtensionType
    {
        get
        {
            return typeof(TraceExtension);
        }
    }

    // User can set priority of the 'SoapExtension'.
    public override int Priority
    {
        get
        {
            return myPriority;
        }
        set
        {
            myPriority = value;
        }
    }

    public string Filename
    {
        get
        {
            return myFilename;
        }
        set
        {
            myFilename = value;
        }
    }
}
' Create a SoapExtensionAttribute for a SOAP extension that can be
' applied to an XML Web service method.
<AttributeUsage(AttributeTargets.Method)> _
Public Class TraceExtensionAttribute
    Inherits SoapExtensionAttribute
    
    Private m_filename As String = "c:\log.txt"
    Private m_priority As Integer

   ' Return the type of 'TraceExtension' class.
    Public Overrides ReadOnly Property ExtensionType() As Type
        Get
            Return GetType(TraceExtension)
        End Get
    End Property

   ' User can set priority of the 'TraceExtension'.
    Public Overrides Property Priority() As Integer
        Get
            Return m_priority
        End Get
        Set(ByVal Value As Integer)
            m_priority = value
        End Set
    End Property

    Public Property Filename() As String
        Get
            Return m_filename
        End Get
        Set(ByVal Value As String)
            m_filename = value
        End Set
    End Property
End Class

설명

ASP.NET을 사용 하 여 만든 XML 웹 서비스 메서드는 XML 웹 서비스 메서드에 특성을 적용 하 여 SOAP 확장을 사용 하 여 실행을 구성할 수 있습니다. 사용자 지정 확장 특성을 XML 웹 서비스 메서드나 클라이언트 프록시 클래스의 메서드를 추가할 때 ASP.NET 적절 한 시간에 연결된 된 확장명을 호출 합니다. 확장 특성에서 파생 된 사용자 지정 특성 클래스는 SoapExtensionAttribute합니다. 파생 된 특성을 재정의 해야 합니다는 ExtensionType 특성과 연결 된 확장의 형식을 반환 하는 속성입니다.

생성자

SoapExtensionAttribute()

SoapExtensionAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

ExtensionType

파생 클래스에서 재정의된 경우 SOAP 확장의 Type을 가져옵니다.

Priority

파생 클래스에서 재정의된 경우 해당 SOAP 확장의 우선 순위를 가져오거나 설정합니다.

TypeId

파생 클래스에서 구현된 경우 이 Attribute에 대한 고유 식별자를 가져옵니다.

(다음에서 상속됨 Attribute)

메서드

Equals(Object)

이 인스턴스가 지정된 개체와 같은지를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
GetHashCode()

이 인스턴스의 해시 코드를 반환합니다.

(다음에서 상속됨 Attribute)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IsDefaultAttribute()

파생 클래스에서 재정의된 경우 이 인스턴스 값이 파생 클래스에 대한 기본값인지 여부를 표시합니다.

(다음에서 상속됨 Attribute)
Match(Object)

파생 클래스에서 재정의된 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Attribute)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

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

이름 집합을 해당하는 디스패치 식별자 집합에 매핑합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

인터페이스의 형식 정보를 가져오는 데 사용할 수 있는 개체의 형식 정보를 검색합니다.

(다음에서 상속됨 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

개체에서 제공하는 형식 정보 인터페이스의 수를 검색합니다(0 또는 1).

(다음에서 상속됨 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

개체에서 노출하는 메서드와 속성에 대한 액세스를 제공합니다.

(다음에서 상속됨 Attribute)

적용 대상

추가 정보