SoapRpcMethodAttribute 클래스

정의

메서드에서 보내거나 받는 SOAP 메시지가 RPC 형식을 사용하도록 지정합니다.

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

예제

다음 코드 예제에서는 메시지 스타일을 설정 Rpc 에 대 한는 GetUserName XML 웹 서비스 메서드.

<%@ WebService Language="C#" class="MyUser" %>
 using System;
 using System.Web.Services;
 using System.Web.Services.Protocols;
 
 public class MyUser : WebService {
 
       [ SoapRpcMethod(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 out the domain name from 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    
    
    <SoapRpcMethod(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 out the domain name from 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

설명

XML 웹 서비스 메서드 또는 작업을 SOAP 메시지의 서식을 지정할 수 하는 방법에 대 한 두 가지 스타일을 정의 하는 WSDL 웹 서비스 설명 언어 (): RPCDocument입니다. RPC SOAP를 사용 하 여 rpc;에 대 한 SOAP 사양에 따라 작업의 형식을 가리킵니다 서식 지정 SOAP 사양 섹션 7 라고도 합니다. RPC XML 웹 서비스 메서드 명명 된 단일 XML 요소 내에서 캡슐화 된 모든 매개 변수 및 해당 XML 요소 내에서 각 XML 요소가 매개 변수를 나타내는 요소가 나타내는 매개 변수 이름이 지정 된 상태를 서식 지정 합니다.

둘 다에서 SOAP 메시지의 형식을 지정 합니다 RPCDocument 스타일; 원격 프로시저 호출 (RPC) 방식으로 XML 웹 서비스와 통신할 수 있지만 Document 느슨하게 결합 된에서 통신 하려면 스타일도 쉽게 사용할 수 있습니다 방식으로 합니다. 따라서 Document 스타일 XML Web services를 사용 하는 것이 좋습니다. 자세한 내용은 참조는 Customizing SOAP Messages 항목입니다.

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

이 특성은 XML 웹 서비스 메서드를 사용 하 여 서버를 클라이언트에서 프록시 클래스를 적용할 수 있습니다. XML 웹 서비스 메서드를 OneWay 속성으로 설정 true 에 대 한 액세스 권한이 없습니다 해당 HttpContext합니다. 이와 같이의 속성 중 하나에 액세스 합니다 WebService 반환 클래스 null합니다.

생성자

SoapRpcMethodAttribute()

모든 속성을 기본값으로 설정하여 SoapRpcMethodAttribute 클래스의 새 인스턴스를 초기화합니다.

SoapRpcMethodAttribute(String)

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

속성

Action

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

Binding

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

OneWay

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

RequestElementName

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

RequestNamespace

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

ResponseElementName

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

ResponseNamespace

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

TypeId

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

(다음에서 상속됨 Attribute)
Use

메서드를 호출할 때 사용되는 바인딩을 가져오거나 설정합니다.

메서드

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)

적용 대상

추가 정보