Export (0) Print
Expand All

WebServiceBindingAttribute.Namespace Property

Gets or sets the namespace associated with the binding.

Namespace:  System.Web.Services
Assembly:  System.Web.Services (in System.Web.Services.dll)

public string Namespace { get; set; }

Property Value

Type: System.String
The namespace for the binding. The default is http://tempuri.org/.

The following example specifies a binding named LocalBindingNonDefaultNamespace that is a member of the http://www.contoso.com/MyBinding namespace and defined in the BindingSample XML Web service.

// Binding is defined in this XML Web service, but it is not a part of the default namespace.
 [ WebServiceBinding(Name="LocalBindingNonDefaultNamespace",
 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";

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft