System.Web.Services.WebServiceAttribute.Namespace Property

Gets or sets the default XML namespace to use for the XML Web service.

Syntax

public string Namespace { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

XML namespaces offer a way to create names in an XML document that are identified by a Uniform Resource Identifier (URI). By using XML namespaces you can uniquely identify elements or attributes in a XML document. The service description for a XML Web service is defined in XML, specifically in Web Services Description Language (WSDL).

Within the Service Description for an XML Web service, WebServiceAttribute.Namespace is used as the default namespace for XML elements directly pertaining to the XML Web service. For example, the name of the XML Web service and its XML Web service methods pertain to the namespace specified in the Namespace property. Elements that are specific to WSDL pertain to the http://schemas.xmlsoap.org/wsdl/ namespace.

For XML Web service clients using SOAP to call an XML Web service, you can optionally add the System.Web.Services.Protocols.SoapDocumentMethodAttribute or System.Web.Services.Protocols.SoapRpcMethodAttribute to call an XML Web service method. If the client is calling an XML Web service created using ASP.NET, the System.Web.Services.Protocols.SoapDocumentMethodAttribute.RequestNamespace, System.Web.Services.Protocols.SoapDocumentMethodAttribute.ResponseNamespace and System.Web.Services.Protocols.SoapDocumentMethodAttribute.Action properties are all derived from the WebServiceAttribute.Namespace property by default. For instance, given an XML Web service method name of Time and a Namespace property of http://www.contoso.com/, the Action property is http://www.contoso.com/Time by default. To change the default settings for RequestNamespace, ResponseNamespace, and Action for an XML Web service method, you can add a System.Web.Services.Protocols.SoapDocumentMethodAttribute to the XML Web service method.

Note:

An XML namespace is different from the namespace the class resides in, in terms of the winsdklong. To specify the namespace for the class, see Namespaces (C# Programmer's Reference) if you writing in C#.

Requirements

Namespace: System.Web.Services
Assembly: System.Web.Services (in System.Web.Services.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0