Freigeben über


WebServiceBindingAttribute.Namespace-Eigenschaft

Ruft den der Bindung zugeordneten Namespace ab oder legt diesen fest.

Namespace: System.Web.Services
Assembly: System.Web.Services (in system.web.services.dll)

Syntax

'Declaration
Public Property Namespace As String
'Usage
Dim instance As WebServiceBindingAttribute
Dim value As String

value = instance.Namespace

instance.Namespace = value
public string Namespace { get; set; }
public:
property String^ Namespace {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Namespace ()

/** @property */
public void set_Namespace (String value)
public function get Namespace () : String

public function set Namespace (value : String)

Eigenschaftenwert

Der Namespace für die Bindung. Der Standardnamespace lautet http://tempuri.org/.

Beispiel

Im folgenden Beispiel wird eine Bindung mit der Bezeichnung LocalBindingNonDefaultNamespace angegeben, die Member des https://www.contoso.com/MyBinding-Namespaces ist und im BindingSample-XML-Webdienst definiert wurde.

' Binding is defined in this XML Web service, but it is not a part of the default namespace.
<WebServiceBinding(Name := "LocalBindingNonDefaultNamespace", _
    Namespace := "https://www.contoso.com/MyBinding")> _
Public Class BindingSample   
    
    <SoapDocumentMethod(Binding := "LocalBindingNonDefaultNamespace"), _
        WebMethod()> _
    Public Function LocalBindingNonDefaultNamespaceMethod() As String
        
        Return "Member of binding defined in this XML Web service, but a part " & _
               "of a different namespace"
    End Function
End Class
 
// Binding is defined in this XML Web service, but it is not a part of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace",
 Namespace="https://www.contoso.com/MyBinding")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBindingNonDefaultNamespace")] 
      [ WebMethod() ]
      public string LocalBindingNonDefaultNamespaceMethod() {
              return "Member of binding defined in this XML Web service, but a part of a different namespace";
      }
 }
 

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

.NET Compact Framework

Unterstützt in: 2.0, 1.0

Siehe auch

Referenz

WebServiceBindingAttribute-Klasse
WebServiceBindingAttribute-Member
System.Web.Services-Namespace