SoapRpcMethodAttribute.ResponseElementName Свойство
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Возвращает или задает XML-элемент, связанный с ответом SOAP для метода веб-службы XML.
public:
property System::String ^ ResponseElementName { System::String ^ get(); void set(System::String ^ value); };
public string ResponseElementName { get; set; }
member this.ResponseElementName : string with get, set
Public Property ResponseElementName As String
Значение свойства
XML-элемент, связанный с запросом SOAP для метода веб-службы XML. Значением по умолчанию является WebServiceNameResultWebServiceName имя метода веб-службы XML.
Примеры
Следующий пример кода задает ResponseElementName для MyCustomResponseElementсвойства значение .
<%@ WebService Language="C#" Class="SoapRpcMethodSample" %>
using System.Web.Services;
using System.Web.Services.Protocols;
public class SoapRpcMethodSample
{
[WebMethod]
[SoapRpcMethod(ResponseNamespace="http://www.contoso.com",ResponseElementName="MyCustomResponseElement")]
public int[] ResponseRpc(int numentries)
{
int[] intarray = new int[numentries];
for (int i=0;i<numentries;i++)
{
intarray[i] = i;
}
return intarray;
}
}
<%@ WebService Language="VB" Class="SoapRpcMethodSample" %>
Imports System.Web.Services
Imports System.Web.Services.Protocols
Public Class SoapRpcMethodSample
<WebMethod(),SoapRpcMethod(ResponseNamespace :="http://www.contoso.com",ResponseElementName := "MyCustomResponseElement")> _
Public Function ResponseRpc(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
Комментарии
Свойство ResponseElementName определяет XML-элемент, используемый для инкапсулировать параметры в Body элементе ответа SOAP.