Share via


SoapMethodAttribute.ResponseXmlNamespace Vlastnost

Definice

Získá nebo nastaví obor názvů elementu XML použitý pro odpověď metody na cílovou metodu.

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

Hodnota vlastnosti

Obor názvů elementu XML použitý pro odpověď metody na cílovou metodu.

Příklady

Následující příklad kódu ukazuje, jak použít ResponseXmlNamespace vlastnost . Tento příklad kódu je součástí většího příkladu SoapMethodAttribute pro třídu .

[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;
}

Platí pro