SoapDocumentMethodAttribute.RequestElementName 속성

정의

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

public:
 property System::String ^ RequestElementName { System::String ^ get(); void set(System::String ^ value); };
public string RequestElementName { get; set; }
member this.RequestElementName : string with get, set
Public Property RequestElementName As String

속성 값

String

서비스 설명에서 작업으로 정의된 XML Web services 메서드의 SOAP 요청과 관련된 XML 요소입니다. 기본값은 XML Web services 메서드의 이름입니다.

예제

다음 코드 예제에서는 SOAP 요청에는 XML 웹 서비스 메서드와 관련 된 XML 요소의 이름을 설정 MyCustomElement합니다.

<%@ WebService Language="C#" Class="SoapDocumentMethodSample" %>
    
using System.Web.Services;
using System.Web.Services.Protocols;

public class SoapDocumentMethodSample
{
   [WebMethod]
   [SoapDocumentMethod(RequestNamespace="http://www.contoso.com",RequestElementName="MyCustomElement")]
   public int[] RequestDocument(int numentries)
   {
    int[] intarray = new int[numentries];
        for (int i=0;i<numentries;i++)
        {
       intarray[i] = i;
        }
        return intarray;
   }
}
<%@ WebService Language="VB" Class="SoapDocumentMethodSample" %>
    
Imports System.Web.Services
Imports System.Web.Services.Protocols

Public Class SoapDocumentMethodSample

   <WebMethod(),SoapDocumentMethod(RequestNamespace :="http://www.contoso.com",RequestElementName := "MyCustomRequestElement")> _
   Public Function  RequestDocument(numentries as Integer) As Integer()
    Dim intarray(numentries - 1) as Integer
        Dim i as Integer
        For i = 0 To numentries - 1
           intarray(i) = i
        Next
        Return intarray
   End Function
End Class

설명

RequestElementName 아래에 있는 매개 변수를 래핑하는 데 사용 하는 XML 요소를 정의 합니다 Body soap 요소를 요청 하는 경우 ParameterStyleWrapped합니다. 이 XML 웹 서비스에 대 한 서비스 설명에서 XML 웹 서비스 메서드에 SOAP 요청을 나타내는 XSD 스키마에 반영 됩니다.

적용 대상