SoapMethodAttribute.ResponseXmlNamespace Tulajdonság

Definíció

Lekéri vagy beállítja a célmetódusra való válaszhoz használt XML-elemnévteret.

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

Tulajdonság értéke

A célmetódusra adott metódus válaszához használt XML-elemnévtér.

Példák

Az alábbi példakód bemutatja, hogyan használhatja a tulajdonságot ResponseXmlNamespace . 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;
}

A következőre érvényes: