SoapMethodAttribute.ResponseXmlNamespace 属性

定义

获取或设置用于响应目标方法的方法的 XML 元素命名空间。Gets or sets the XML element namespace used for method response to the target method.

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

属性值

String

用于对目标方法的方法响应的 XML 元素命名空间。The XML element namespace used for method response to the target method.

示例

下面的代码示例说明如何使用 ResponseXmlNamespace 属性。The following code example shows how to use the ResponseXmlNamespace property. 此代码示例是为类提供的更大示例的一部分 SoapMethodAttributeThis code example is part of a larger example provided for the SoapMethodAttribute class.

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

适用于