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.
System.Web.Services.Description.DocumentableItem
System.Web.Services.Description.NamedItem
System.Web.Services.Description.ServiceDescription
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in System.Web.Services.dll)
The ServiceDescription type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | Bindings | Gets the collection of Binding elements contained in the ServiceDescription. |
![]() | Documentation | Gets or sets the text documentation for the instance of the DocumentableItem. (Inherited from DocumentableItem.) |
![]() | DocumentationElement | Gets or sets the documentation element for the DocumentableItem. (Inherited from DocumentableItem.) |
![]() | ExtensibleAttributes | Gets or sets an array of type XmlAttribute that represents attribute extensions of WSDL to comply with Web Services Interoperability (WS-I) Basic Profile 1.1. (Inherited from DocumentableItem.) |
![]() | Extensions | Gets the collection of extensibility elements contained in the ServiceDescription. (Overrides DocumentableItem.Extensions.) |
![]() | Imports | Gets the collection of Import elements contained in the ServiceDescription. |
![]() | Messages | Gets the collection of Message elements contained in the ServiceDescription. |
![]() | Name | Gets or sets the name of the item. (Inherited from NamedItem.) |
![]() | Namespaces | Gets or sets the dictionary of namespace prefixes and namespaces used to preserve namespace prefixes and namespaces when a ServiceDescription object is constructed. (Inherited from DocumentableItem.) |
![]() | PortTypes | Gets the collection of PortType elements contained in the ServiceDescription. |
![]() | RetrievalUrl | Gets or sets the URL of the XML Web service to which the ServiceDescription instance applies. |
![]() ![]() | Schema | Gets the schema associated with this ServiceDescription. |
![]() ![]() | Serializer | Gets the XML serializer used to serialize and deserialize between a ServiceDescription object and a Web Services Description Language (WSDL) document. |
![]() | ServiceDescriptions | Gets the ServiceDescriptionCollection instance of which the ServiceDescription is a member. |
![]() | Services | Gets the collection of Service instances contained in the ServiceDescription. |
![]() | TargetNamespace | Gets or sets the XML targetNamespace attribute of the descriptions tag enclosing a Web Services Description Language (WSDL) file. |
![]() | Types | Gets or sets the Types contained by the ServiceDescription. |
![]() | ValidationWarnings | Gets a StringCollection that contains any validation warnings that were generated during a call to Read(Stream, Boolean), Read(TextReader, Boolean), Read(String, Boolean), or Read(XmlReader, Boolean) with the validate parameter set to true. |
| Name | Description | |
|---|---|---|
![]() ![]() | CanRead | Gets a value that indicates whether an XmlReader represents a valid Web Services Description Language (WSDL) file that can be parsed. |
![]() | Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() ![]() | Read(Stream) | Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance. |
![]() ![]() | Read(String) | Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file. |
![]() ![]() | Read(TextReader) | Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader. |
![]() ![]() | Read(XmlReader) | Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader. |
![]() ![]() | Read(Stream, Boolean) | Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance. |
![]() ![]() | Read(String, Boolean) | Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file. |
![]() ![]() | Read(TextReader, Boolean) | Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader. |
![]() ![]() | Read(XmlReader, Boolean) | Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader. |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
![]() | Write(Stream) | Writes out the ServiceDescription to the specified Stream. |
![]() | Write(String) | Writes out the ServiceDescription as a Web Services Description Language (WSDL) file to the specified path. |
![]() | Write(TextWriter) | Writes out the ServiceDescription as a Web Services Description Language (WSDL) file to the TextWriter. |
![]() | Write(XmlWriter) | Writes out the ServiceDescription to the XmlWriter as a Web Services Description Language (WSDL) file. |
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 http://www.w3.org/TR/wsdl/.
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; myBindingCollection.Remove(myBindingCollection[0]); // 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 = "http://schemas.xmlsoap.org/soap/http"; mySoapBinding.Style = SoapBindingStyle.Document; OperationBinding addOperationBinding = CreateOperationBinding("Add",myDescription.TargetNamespace); myBinding.Operations.Add(addOperationBinding); myBinding.Extensions.Add(mySoapBinding); // Add the Binding to the ServiceDescription. myDescription.Bindings.Add(myBinding); myDescription.Write("MyOutWsdl.wsdl");
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
