This documentation is archived and is not being maintained.

WebServiceBindingAttribute Constructor

.NET Framework 1.1

Initializes a new instance of the WebServiceBindingAttribute class.

Overload List

Initializes a new instance of the WebServiceBindingAttribute class.

Supported by the .NET Compact Framework.

[Visual Basic] Public Sub New()
[C#] public WebServiceBindingAttribute();
[C++] public: WebServiceBindingAttribute();
[JScript] public function WebServiceBindingAttribute();

Initializes a new instance of the WebServiceBindingAttribute class setting the name of the binding the XML Web service method is implementing.

Supported by the .NET Compact Framework.

[Visual Basic] Public Sub New(String)
[C#] public WebServiceBindingAttribute(string);
[C++] public: WebServiceBindingAttribute(String*);
[JScript] public function WebServiceBindingAttribute(String);

Initializes a new instance of the WebServiceBindingAttribute class.

Supported by the .NET Compact Framework.

[Visual Basic] Public Sub New(String, String)
[C#] public WebServiceBindingAttribute(string, string);
[C++] public: WebServiceBindingAttribute(String*, String*);
[JScript] public function WebServiceBindingAttribute(String, String);

Initializes a new instance of the WebServiceBindingAttribute class.

Supported by the .NET Compact Framework.

[Visual Basic] Public Sub New(String, String, String)
[C#] public WebServiceBindingAttribute(string, string, string);
[C++] public: WebServiceBindingAttribute(String*, String*, String*);
[JScript] public function WebServiceBindingAttribute(String, String, String);

Example

[Visual Basic, C#] The following example specifies a binding named RemoteBinding that is a member of the http://www.contoso.com/MyBinding namespace and defined at http://www.contoso.com/MyService.asmx?wsdl.

[Visual Basic, C#] Note   This example shows how to use one of the overloaded versions of the WebServiceBindingAttribute constructor. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
' Binding is defined on a remote server, but this XML Web service implements
' at least one operation in that binding.
<WebServiceBinding(Name := "RemoteBinding", _
    Namespace := "http://www.contoso.com/MyBinding", _
    Location := "http://www.contoso.com/MyService.asmx?wsdl")> _
Public Class BindingSample    
    
    <SoapDocumentMethod(Binding := "RemoteBinding"), WebMethod()> _
    Public Function RemoteBindingMethod() As String
        
        Return "Member of a binding defined on another server"
    End Function
End Class
 

[C#] 

// Binding is defined on a remote server, but this XML Web service implements
// at least one operation in that binding.
 [ WebServiceBinding(Name="RemoteBinding", 
              Namespace="http://www.contoso.com/MyBinding",
             Location="http://www.contoso.com/MyService.asmx?wsdl" )]
 public class BindingSample  {

     [ SoapDocumentMethod(Binding="RemoteBinding")] 
     [ WebMethod() ]
      public string RemoteBindingMethod() {
              return "Member of a binding defined on another server";
      }
 }
 

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

WebServiceBindingAttribute Class | WebServiceBindingAttribute Members | System.Web.Services Namespace

Show: