WebServiceBindingAttribute-Konstruktor (String, String)

Initialisiert eine neue Instanz der WebServiceBindingAttribute-Klasse.

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

Syntax

'Declaration
Public Sub New ( _
    name As String, _
    ns As String _
)
'Usage
Dim name As String
Dim ns As String

Dim instance As New WebServiceBindingAttribute(name, ns)
public WebServiceBindingAttribute (
    string name,
    string ns
)
public:
WebServiceBindingAttribute (
    String^ name, 
    String^ ns
)
public WebServiceBindingAttribute (
    String name, 
    String ns
)
public function WebServiceBindingAttribute (
    name : String, 
    ns : String
)

Parameter

  • name
    Der Name der Bindung, für die eine XML-Webdienstmethode eine Operation implementiert. Legt die Name-Eigenschaft fest.
  • ns
    Der der Bindung zugeordnete Namespace. Legt die Namespace-Eigenschaft fest.

Hinweise

Dieser Konstruktor wird für die Angabe eines Namens für eine Bindung verwendet, die im XML-Webdienst, auf den er angewendet wird, definiert ist. Der Konstruktor ist Member des angegebenen Namespace.

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
Name
Namespace
SoapDocumentMethodAttribute
SoapRpcMethodAttribute