Sdílet prostřednictvím


SoapDocumentMethodAttribute.RequestElementName Vlastnost

Definice

Získá nebo nastaví XML element asociované s požadavek SOAP na metodu webové služby XML, která je definována v popisu služby jako operace.

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

Hodnota vlastnosti

String

Element XML přidružený k požadavku SOAP pro metodu webové služby XML, která je definována v popisu služby jako operace. Výchozí hodnota je název metody webové služby XML.

Příklady

Následující příklad kódu nastaví název XML element asociované s metodou webové služby XML v požadavku SOAP na 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

Poznámky

Definuje RequestElementName element XML použitý k zabalení parametrů pod Body element požadavku SOAP, pokud ParameterStyle je Wrapped. To se odráží ve schématu XSD představující požadavek SOAP na metodu webové služby XML v popisu služby pro webovou službu XML.

Platí pro