This documentation is archived and is not being maintained.

ServiceDescription Class

Provides a means of creating and formatting a valid Web Services Description Language (WSDL) document file, complete with appropriate namespaces, elements, and attributes, for describing an XML Web service. This class cannot be inherited.

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

public sealed class ServiceDescription : NamedItem

Instances of this class can be created with either the new keyword or the static Read method, which parses a WSDL file and assigns its values to appropriate members of the class.

WSDL is an XML-based language for describing XML Web services. The ServiceDescription class corresponds to the root element, definitions, of a WSDL file. For more information about WSDL, see the specification at

The following example shows how to create an instance of the ServiceDescription class.

// Obtain the ServiceDescription of existing Wsdl.
ServiceDescription myDescription = ServiceDescription.Read("MyWsdl_CS.wsdl");
// Remove the Binding from the Binding Collection of ServiceDescription.
BindingCollection myBindingCollection = myDescription.Bindings;

// Form a new Binding.
Binding myBinding = new Binding();
myBinding.Name = "Service1Soap";
XmlQualifiedName myXmlQualifiedName = 
                     new XmlQualifiedName("s0:Service1Soap");
myBinding.Type = myXmlQualifiedName;

SoapBinding mySoapBinding = new SoapBinding();
mySoapBinding.Transport = "";
mySoapBinding.Style = SoapBindingStyle.Document;

OperationBinding addOperationBinding = 

// Add the Binding to the ServiceDescription.
// Obtain the ServiceDescription of existing Wsdl.
ServiceDescription* myDescription = ServiceDescription::Read(S"MyWsdl_CS.wsdl");
// Remove the Binding from the Binding Collection of ServiceDescription.
BindingCollection* myBindingCollection = myDescription->Bindings;

// Form a new Binding.
Binding* myBinding = new Binding();
myBinding->Name = S"Service1Soap";
XmlQualifiedName* myXmlQualifiedName = 
   new XmlQualifiedName(S"s0:Service1Soap");
myBinding->Type = myXmlQualifiedName;

SoapBinding* mySoapBinding = new SoapBinding();
mySoapBinding->Transport = S"";
mySoapBinding->Style = SoapBindingStyle::Document;

OperationBinding* addOperationBinding = 

// Add the Binding to the ServiceDescription.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0