SoapDocumentMethodAttribute 클래스

정의

메서드에 SoapDocumentMethodAttribute를 사용하면 해당 메서드가 적용되는 SOAP 메시지는 Document 형식으로 지정됩니다.

public ref class SoapDocumentMethodAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method)]
public sealed class SoapDocumentMethodAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public sealed class SoapDocumentMethodAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
type SoapDocumentMethodAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type SoapDocumentMethodAttribute = class
    inherit Attribute
Public NotInheritable Class SoapDocumentMethodAttribute
Inherits Attribute
상속
SoapDocumentMethodAttribute
특성

예제

다음 코드 예제에서는 메시지 스타일을 설정 Document 에 대 한는 GetUserName XML 웹 서비스 메서드. 또한 사용 하 여 XML 요소를 Body SOAP 요청과 SOAP 응답에 대 한 요소 설정 됩니다 GetUserNameRequestGetUserNameResponse, 각각.

<%@ WebService Language="C#" class="MyUser" %>
 using System;
 using System.Web.Services;
 using System.Web.Services.Protocols;
 
 public class MyUser : WebService {
 
       [ SoapDocumentMethod(Action="http://www.contoso.com/Sample", 
           RequestNamespace="http://www.contoso.com/Request",
           RequestElementName="GetUserNameRequest",
           ResponseNamespace="http://www.contoso.com/Response",
           ResponseElementName="GetUserNameResponse")]
      [ WebMethod(Description="Obtains the User Name") ]
      public UserName GetUserName() {
           string temp;
           int pos;
           UserName NewUser = new UserName();
           
           // Get the full user name, including the domain name if applicable.
           temp = User.Identity.Name;
 
           // Determine whether the user is part of a domain by searching for a backslash.
           pos = temp.IndexOf("\\");
           
           // Parse the domain name out of the string, if one exists.
           if (pos <= 0)
                 NewUser.Name = User.Identity.Name;
           else {
               NewUser.Name = temp.Remove(0,pos+1);
                 NewUser.Domain = temp.Remove(pos,temp.Length-pos);
           } 
       return NewUser;
      }
 
 }   
 
 public class UserName {
 
     public string Name;
     public string Domain;
 }
<%@ WebService Language="VB" class="MyUser" %>
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols

Public Class MyUser
    Inherits WebService    
    
    <SoapDocumentMethod(Action := "http://www.contoso.com/Sample", _
    RequestNamespace := "http://www.contoso.com/Request", _
    RequestElementName := "GetUserNameRequest", _
    ResponseNamespace := "http://www.contoso.com/Response", _
    ResponseElementName := "GetUserNameResponse"), _
    WebMethod(Description := "Obtains the User Name")> _
    Public Function GetUserName() As UserName
        
        Dim temp As String
        Dim pos As Integer
        Dim NewUser As New UserName()
        
        ' Get the full user name, including the domain name if applicable.
        temp = User.Identity.Name
        
        ' Determine whether the user is part of a Domain by searching for a backslash.
        pos = temp.IndexOf("\")
        
        ' Parse the domain name out of the string, if one exists.
        If pos <= 0 Then
            NewUser.Name = User.Identity.Name
        Else
            NewUser.Name = temp.Remove(0, pos + 1)
            NewUser.Domain = temp.Remove(pos, temp.Length - pos)
        End If
        Return NewUser
    End Function
End Class 

Public Class UserName
    
    Public Name As String
    Public Domain As String
End Class

설명

SOAP 메시지의 작업을 호출 하는 XML 웹 서비스 메서드를 다시 사용할 수 하는 방법에 대 한 두 가지 스타일을 정의 하는 WSDL 웹 서비스 설명 언어 (): RPCDocument입니다. Document 형식 지정 XSD 스키마에 따라 XML 웹 서비스 메서드를 가리킵니다. Document 스타일 서식을 참조 하는 Body 요소 다음에 대 한 하나 이상의 메시지 파트의 일련의 Body 요소입니다. 개별 메시지 파트 기준 정확 하 게 합니다 UseParameterStyle 속성입니다. 합니다 Use 속성 매개 변수는 형식이 지정 하는지 여부를 결정 Encoded 또는 Literal합니다. ParameterStyle 매개 변수는 단일 메시지 파트 다음 내에서 캡슐화 되는지 여부를 결정 합니다 Body 요소 또는 각 매개 변수에 개별 메시지 파트를 인지 합니다.

자세한 내용은 참조 하세요. SOAP 메시지 형식을 사용자 지정합니다.

이 특성은 클라이언트에서 프록시 클래스의 메서드 및 XML 웹 서비스 메서드를 사용 하 여 서버를 둘 다에 적용할 수 있습니다.

생성자

SoapDocumentMethodAttribute()

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

SoapDocumentMethodAttribute(String)

SoapDocumentMethodAttribute 속성을 action 매개 변수 값으로 설정하여 Action 클래스의 새 인스턴스를 초기화합니다.

속성

Action

SOAP 요청의 SOAPAction HTTP 헤더 필드를 가져오거나 설정합니다.

Binding

XML Web services 메서드에서 작업을 구현하고 있는 바인딩을 가져오거나 설정합니다.

OneWay

웹 서버가 XML Web services 메서드 처리를 완료할 때까지 XML Web services 클라이언트에서 대기하는지 여부를 가져오거나 설정합니다.

ParameterStyle

SOAP 메시지의 XML 부분에 있는 Body 요소 아래의 단일 XML 요소 내에서 매개 변수가 캡슐화되는지 여부를 가져오거나 설정합니다.

RequestElementName

서비스 설명에서 작업으로 정의된 XML Web services 메서드의 SOAP 요청과 관련된 XML 요소를 가져오거나 설정합니다.

RequestNamespace

XML Web services 메서드의 SOAP 요청과 관련된 네임스페이스를 가져오거나 설정합니다.

ResponseElementName

XML Web services 메서드의 SOAP 응답과 관련된 XML 요소를 가져오거나 설정합니다.

ResponseNamespace

XML Web services 메서드의 SOAP 응답과 관련된 XML 네임스페이스를 가져오거나 설정합니다.

TypeId

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

(다음에서 상속됨 Attribute)
Use

SOAP 메시지의 XML 부분에서 XML Web services 메서드의 매개 변수 형식을 가져오거나 설정합니다.

메서드

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)

적용 대상

추가 정보