Export (0) Print
Expand All

WebServiceBindingAttribute.Name Property

Gets or sets the name of the binding.

[Visual Basic]
Public Property Name As String
[C#]
public string Name {get; set;}
[C++]
public: __property String* get_Name();
public: __property void set_Name(String*);
[JScript]
public function get Name() : String;
public function set Name(String);

Property Value

The name of the binding. The default is the name of the XML Web service with "Soap" appended.

Example

[Visual Basic, C#] The following example specifies a binding named LocalBinding that is defined in the BindingSample XML Web service.

[Visual Basic] 
' Binding is defined in this XML Web service and uses the default namespace.
<WebServiceBinding(Name := "LocalBinding")> _
Public Class BindingSample    
    
    <SoapDocumentMethod(Binding := "LocalBinding"), WebMethod()> _
    Public Function LocalBindingMethod() As String
    
        Return "Member of binding defined in this XML Web service and member of the default namespace"
    End Function 'LocalBindingMethod
    
End Class
   

[C#] 
// Binding is defined in this XML Web service and uses the default namespace.
 [ WebServiceBinding(Name="LocalBinding")]
 public class BindingSample  {

      [ SoapDocumentMethod(Binding="LocalBinding")]
      [ WebMethod() ]
      public string LocalBindingMethod() {
               return "Member of binding defined in this XML Web service and member of the default namespace";
      }

 }
   

[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.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

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

Show:
© 2014 Microsoft