SoapDocumentMethodAttribute 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
메서드에 SoapDocumentMethodAttribute 적용하면 메서드와 메서드의 SOAP 메시지가 Document 서식을 사용하도록 지정됩니다.
public ref class SoapDocumentMethodAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Method)]
public sealed class SoapDocumentMethodAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Method)>]
type SoapDocumentMethodAttribute = class
inherit Attribute
Public NotInheritable Class SoapDocumentMethodAttribute
Inherits Attribute
- 상속
- 특성
예제
다음 코드 예제에서는 XML 웹 서비스 메서드에 DocumentGetUserName 대 한 메시지 스타일을 설정 합니다. 또한 SOAP 요청 및 SOAP 응답에 대한 요소가 있는 Body XML 요소는 각각 및 그로 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
설명
WSDL(Web Services Description Language)은 작업을 호출하는 XML 웹 서비스 메서드가 SOAP 메시지 RPC 에서 형식을 지정할 수 있는 방법에 대한 두 가지 스타일을 정의합니다 Document.
Document 은 XSD 스키마에 따라 XML 웹 서비스 메서드의 서식을 지정하는 것을 의미합니다. 이 스타일은 Document 요소 다음에 있는 하나 이상의 메시지 파트로 요소의 서식을 지정하는 Body 것을 Body 말합니다. 개별 메시지 파트가 및 ParameterStyle 속성에 의해 Use 결정되는 정확한 방법입니다. 이 속성은 Use 매개 변수의 형식 EncodedLiteral을 지정할지 여부를 결정합니다. 매개 ParameterStyle 변수가 요소 다음에 Body 있는 단일 메시지 파트 내에 캡슐화되는지 또는 각 매개 변수가 개별 메시지 파트인지 여부를 결정합니다.
자세한 내용은 SOAP 메시지 서식 사용자 지정을 참조하세요.
이 특성은 서버의 XML 웹 서비스 메서드와 클라이언트의 프록시 클래스 메서드 모두에 적용할 수 있습니다.
생성자
| Name | Description |
|---|---|
| SoapDocumentMethodAttribute() |
SoapDocumentMethodAttribute 클래스의 새 인스턴스를 초기화합니다. |
| SoapDocumentMethodAttribute(String) |
클래스의 새 인스턴스를 SoapDocumentMethodAttribute 초기화하고 속성을 매개 변수 값 |
속성
| Name | Description |
|---|---|
| Action |
SOAP 요청의 |
| Binding |
XML 웹 서비스 메서드가 작업을 구현하는 바인딩을 가져오거나 설정합니다. |
| OneWay |
XML 웹 서비스 클라이언트가 웹 서버가 XML 웹 서비스 메서드 처리를 완료할 때까지 대기하는지 여부를 가져오거나 설정합니다. |
| ParameterStyle |
매개 변수가 SOAP 메시지의 XML 부분에 있는 요소 아래에 |
| RequestElementName |
서비스 설명에 작업으로 정의된 XML 웹 서비스 메서드에 대한 SOAP 요청과 연결된 XML 요소를 가져오거나 설정합니다. |
| RequestNamespace |
XML 웹 서비스 메서드에 대한 SOAP 요청과 연결된 네임스페이스를 가져오거나 설정합니다. |
| ResponseElementName |
XML 웹 서비스 메서드에 대한 SOAP 응답과 연결된 XML 요소를 가져오거나 설정합니다. |
| ResponseNamespace |
XML 웹 서비스 메서드에 대한 SOAP 응답과 연결된 XML 네임스페이스를 가져오거나 설정합니다. |
| TypeId |
파생 클래스에서 구현되는 경우 이 Attribute대한 고유 식별자를 가져옵니다. (다음에서 상속됨 Attribute) |
| Use |
SOAP 메시지의 XML 부분 내에서 XML 웹 서비스 메서드에 대한 매개 변수 서식을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| Equals(Object) |
이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (다음에서 상속됨 Attribute) |
| GetHashCode() |
이 인스턴스의 해시 코드를 반환합니다. (다음에서 상속됨 Attribute) |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| IsDefaultAttribute() |
파생 클래스에서 재정의되는 경우 이 인스턴스의 값이 파생 클래스의 기본값인지 여부를 나타냅니다. (다음에서 상속됨 Attribute) |
| Match(Object) |
파생 클래스에서 재정의되는 경우 이 인스턴스가 지정된 개체와 같은지 여부를 나타내는 값을 반환합니다. (다음에서 상속됨 Attribute) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| _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) |