Aracılığıyla paylaş


SoapMethodAttribute.XmlNamespace Özellik

Tanım

Hedef yöntemin uzak yöntem çağrılarının seri hale getirilmesi sırasında kullanılan XML ad alanını alır veya ayarlar.

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

Özellik Değeri

Hedef yöntemin uzak yöntem çağrılarının seri hale getirilmesi sırasında kullanılan XML ad alanı.

Örnekler

Aşağıdaki kod örneği özelliğinin XmlNamespace nasıl kullanılacağını gösterir. Bu kod örneği, sınıfı için SoapMethodAttribute sağlanan daha büyük bir örneğin parçasıdır.

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

Şunlara uygulanır