SoapMethodAttribute 클래스

정의

메서드에 대한 SOAP 생성 및 처리를 사용자 지정합니다. 이 클래스는 상속될 수 없습니다.

public ref class SoapMethodAttribute sealed : System::Runtime::Remoting::Metadata::SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Method)]
public sealed class SoapMethodAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[System.AttributeUsage(System.AttributeTargets.Method)]
[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SoapMethodAttribute : System.Runtime.Remoting.Metadata.SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
type SoapMethodAttribute = class
    inherit SoapAttribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SoapMethodAttribute = class
    inherit SoapAttribute
Public NotInheritable Class SoapMethodAttribute
Inherits SoapAttribute
상속
SoapMethodAttribute
특성

예제

다음 코드 예제에서는 클래스의 멤버를 사용하여 메서드에 SoapMethodAttribute 대한 SOAP 생성 및 처리를 사용자 지정하는 방법을 보여줍니다.

#using <System.dll>
#using <System.Runtime.Remoting.dll>
using namespace System;
using namespace System::Runtime::Remoting::Metadata;

namespace ExampleNamespace
{
   public ref class ExampleClass
   {
   public:
      [SoapMethod(
         ResponseXmlElementName="ExampleResponseElement",
         ResponseXmlNamespace=
         "http://example.org/MethodResponseXmlNamespace",
         ReturnXmlElementName="HelloMessage",
         SoapAction="http://example.org/ExampleSoapAction#GetHello",
         XmlNamespace="http://example.org/MethodCallXmlNamespace")]
      String^ GetHello( String^ name )
      {
         return String::Format( L"Hello, {0}", name );
      }
   };

}

int main()
{
   
   // Get the method info object for the GetHello method.
   System::Reflection::MethodBase^ getHelloMethod = 
      ExampleNamespace::ExampleClass::typeid->GetMethod( L"GetHello" );
   
   // Print the XML namespace for the invocation of this method.
   String^ methodCallXmlNamespace =
      System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall(
         getHelloMethod );
   Console::WriteLine( L"The XML namespace for the response of the method "
         L"GetHello in ExampleClass is {0}.", methodCallXmlNamespace );
   
   // Print the XML namespace for the response of this method.
   String^ methodResponseXmlNamespace =
      System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall(
         getHelloMethod );
   Console::WriteLine( L"The XML namespace for the invocation of the method "
         L"GetHello in ExampleClass is {0}.", methodResponseXmlNamespace );
   
   // Print the SOAP action for this method.
   String^ getHelloSoapAction =
      System::Runtime::Remoting::SoapServices::GetXmlNamespaceForMethodCall(
         getHelloMethod );
   Console::WriteLine( L"The SOAP action for the method "
         L"GetHello in ExampleClass is {0}.", getHelloSoapAction );
}
using System;
using System.Runtime.Remoting.Metadata;

namespace ExampleNamespace
{
    public class ExampleClass
    {
        [SoapMethod(
             ResponseXmlElementName="ExampleResponseElement",
             ResponseXmlNamespace=
                "http://example.org/MethodResponseXmlNamespace",
             ReturnXmlElementName="HelloMessage",
             SoapAction="http://example.org/ExampleSoapAction#GetHello",
             XmlNamespace="http://example.org/MethodCallXmlNamespace")]
        public string GetHello(string name)
        {
            return "Hello, " + name;
        }
    }
}

public class Demo
{
    public static void Main(string[] args)
    {
        // Get the method info object for the GetHello method.
        System.Reflection.MethodBase getHelloMethod =
            typeof(ExampleNamespace.ExampleClass).GetMethod("GetHello");

        // Print the XML namespace for the invocation of this method.
        string methodCallXmlNamespace =
            System.Runtime.Remoting.SoapServices.
                GetXmlNamespaceForMethodCall(getHelloMethod);
        Console.WriteLine(
            "The XML namespace for the response of the method " +
            "GetHello in ExampleClass is {0}.",
            methodCallXmlNamespace);

        // Print the XML namespace for the response of this method.
        string methodResponseXmlNamespace =
            System.Runtime.Remoting.SoapServices.
                GetXmlNamespaceForMethodResponse(getHelloMethod);
        Console.WriteLine(
            "The XML namespace for the invocation of the method " +
            "GetHello in ExampleClass is {0}.",
            methodResponseXmlNamespace);

        // Print the SOAP action for this method.
        string getHelloSoapAction =
            System.Runtime.Remoting.SoapServices.
                GetSoapActionFromMethodBase(getHelloMethod);
        Console.WriteLine(
            "The SOAP action for the method " +
            "GetHello in ExampleClass is {0}.",
            getHelloSoapAction);
    }
}

설명

특성의 SoapMethodAttribute 대상 개체는 원격으로 호출할 수 있는 메서드입니다. SoapMethodAttribute 를 적용하여 SOAP 생성 및 처리를 사용자 지정합니다. 이 특성의 속성을 사용하면 프로그래머가 SOAPACTION HTTP 헤더 필드를 사용자 지정하여 SOAP HTTP 요청의 의도를 나타낼 수 있습니다.

생성자

SoapMethodAttribute()

SoapMethodAttribute의 인스턴스를 만듭니다.

필드

ProtXmlNamespace

현재 SOAP 특성의 대상이 serialize되는 XML 네임스페이스입니다.

(다음에서 상속됨 SoapAttribute)
ReflectInfo

XML serialization 정보 설정을 위해 SoapAttribute 클래스에서 파생된 특성 클래스에 사용되는 리플렉션 개체입니다.

(다음에서 상속됨 SoapAttribute)

속성

Embedded

SOAP serialization을 수행하는 동안 형식이 중첩될지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 SoapAttribute)
ResponseXmlElementName

대상 메서드에 대한 메서드 응답에 사용할 XML 요소 이름을 가져오거나 설정합니다.

ResponseXmlNamespace

대상 메서드에 대한 메서드 응답에 사용되는 XML 요소 네임스페이스를 가져오거나 설정합니다.

ReturnXmlElementName

대상 메서드의 반환 값에 사용되는 XML 요소 이름을 가져오거나 설정합니다.

SoapAction

이 메서드를 통해 보낸 HTTP와 함께 사용되는 SOAPAction 헤더 필드를 가져오거나 설정합니다. 현재 이 속성은 구현되지 않습니다.

TypeId

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

(다음에서 상속됨 Attribute)
UseAttribute

현재 특성의 대상이 XML 필드가 아닌 XML 특성으로 serialize될지 여부를 나타내는 값을 가져오거나 설정합니다.

XmlNamespace

대상 메서드의 원격 메서드 호출을 serialize하는 동안 사용되는 XML 네임스페이스를 가져오거나 설정합니다.

메서드

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)

적용 대상