Nyelv

SoapMethodAttribute.ResponseXmlElementName Tulajdonság

Definíció

Lekéri vagy beállítja a célmetódusra adott metódus válaszához használandó XML-elemnevet.

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

Tulajdonság értéke

A célmetódusra adott metódus válaszához használandó XML-elem neve.

Példák

Az alábbi példakód bemutatja, hogyan használhatja a tulajdonságot ResponseXmlElementName . Ez a példakód egy nagyobb, az SoapMethodAttribute osztályhoz tartozó példa része.

[SoapMethod(
   ResponseXmlElementName="ExampleResponseElement",
   ResponseXmlNamespace=
   "http://example.org/MethodResponseXmlNamespace",
   ReturnXmlElementName="HelloMessage",
   SoapAction="http://example.org/ExampleSoapAction#GetHello",
   XmlNamespace="http://example.org/MethodCallXmlNamespace")]
String^ GetHello( String^ name )
{
   return String::Format( L"Hello, {0}", name );
}
[SoapMethod(
     ResponseXmlElementName="ExampleResponseElement",
     ResponseXmlNamespace=
        "http://example.org/MethodResponseXmlNamespace",
     ReturnXmlElementName="HelloMessage",
     SoapAction="http://example.org/ExampleSoapAction#GetHello",
     XmlNamespace="http://example.org/MethodCallXmlNamespace")]
public string GetHello(string name)
{
    return "Hello, " + name;
}

Megjegyzések

Ennek a tulajdonságnak az alapértelmezett értéke a metódus nevéhez fűzött "Válasz" sztring.

A következőre érvényes: