ServiceDescription ServiceDescription ServiceDescription ServiceDescription Class

Definition

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.

public ref class ServiceDescription sealed : System::Web::Services::Description::NamedItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class ServiceDescription : System.Web.Services.Description.NamedItem
type ServiceDescription = class
    inherit NamedItem
Public NotInheritable Class ServiceDescription
Inherits NamedItem
Inheritance
ServiceDescriptionServiceDescriptionServiceDescriptionServiceDescription
Attributes

Examples

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 = gcnew Binding;
myBinding->Name = "Service1Soap";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Service1Soap" );
myBinding->Type = myXmlQualifiedName;
SoapBinding^ mySoapBinding = gcnew 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" );
// 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");
' Obtain the ServiceDescription of existing Wsdl.
Dim myDescription As ServiceDescription = ServiceDescription.Read("MyWsdl_VB.wsdl")
' Remove the Binding from the Binding Collection of ServiceDescription.
Dim myBindingCollection As BindingCollection = myDescription.Bindings
myBindingCollection.Remove(myBindingCollection(0))

' Form a new Binding.
Dim myBinding As New Binding()
myBinding.Name = "Service1Soap"
Dim myXmlQualifiedName As New XmlQualifiedName("s0:Service1Soap")
myBinding.Type = myXmlQualifiedName

Dim mySoapBinding As New SoapBinding()
mySoapBinding.Transport = "http://schemas.xmlsoap.org/soap/http"
mySoapBinding.Style = SoapBindingStyle.Document

Dim addOperationBinding As OperationBinding = 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")

Remarks

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 WSDL specification.

Constructors

ServiceDescription() ServiceDescription() ServiceDescription() ServiceDescription()

Initializes a new instance of the ServiceDescription class.

Fields

Namespace Namespace Namespace Namespace

The XML namespace in which the ServiceDescription class is defined ("http://schemas.xmlsoap.org/wsdl/"). This field is constant.

Properties

Bindings Bindings Bindings Bindings

Gets the collection of Binding elements contained in the ServiceDescription.

Documentation Documentation Documentation Documentation

Gets or sets the text documentation for the instance of the DocumentableItem.

(Inherited from DocumentableItem)
DocumentationElement DocumentationElement DocumentationElement DocumentationElement

Gets or sets the documentation element for the DocumentableItem.

(Inherited from DocumentableItem)
ExtensibleAttributes ExtensibleAttributes ExtensibleAttributes 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 Extensions Extensions Extensions

Gets the collection of extensibility elements contained in the ServiceDescription.

Imports Imports Imports Imports

Gets the collection of Import elements contained in the ServiceDescription.

Messages Messages Messages Messages

Gets the collection of Message elements contained in the ServiceDescription.

Name Name Name Name

Gets or sets the XML name attribute of the descriptions tag enclosing the Web Services Description Language (WSDL) file.

Namespaces Namespaces Namespaces 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 PortTypes PortTypes PortTypes

Gets the collection of PortType elements contained in the ServiceDescription.

RetrievalUrl RetrievalUrl RetrievalUrl RetrievalUrl

Gets or sets the URL of the XML Web service to which the ServiceDescription instance applies.

Schema Schema Schema Schema

Gets the schema associated with this ServiceDescription.

Serializer Serializer Serializer Serializer

Gets the XML serializer used to serialize and deserialize between a ServiceDescription object and a Web Services Description Language (WSDL) document.

ServiceDescriptions ServiceDescriptions ServiceDescriptions ServiceDescriptions

Gets the ServiceDescriptionCollection instance of which the ServiceDescription is a member.

Services Services Services Services

Gets the collection of Service instances contained in the ServiceDescription.

TargetNamespace TargetNamespace TargetNamespace TargetNamespace

Gets or sets the XML targetNamespace attribute of the descriptions tag enclosing a Web Services Description Language (WSDL) file.

Types Types Types Types

Gets or sets the Types contained by the ServiceDescription.

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

Methods

CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader) CanRead(XmlReader)

Gets a value that indicates whether an XmlReader represents a valid Web Services Description Language (WSDL) file that can be parsed.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Read(Stream) Read(Stream) Read(Stream) Read(Stream)

Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

Read(Stream, Boolean) Read(Stream, Boolean) Read(Stream, Boolean) Read(Stream, Boolean)

Initializes an instance of the ServiceDescription class by directly loading the XML from a Stream instance.

Read(String) Read(String) Read(String) Read(String)

Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

Read(String, Boolean) Read(String, Boolean) Read(String, Boolean) Read(String, Boolean)

Initializes an instance of a ServiceDescription object by directly loading the XML from the specified file.

Read(TextReader) Read(TextReader) Read(TextReader) Read(TextReader)

Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

Read(TextReader, Boolean) Read(TextReader, Boolean) Read(TextReader, Boolean) Read(TextReader, Boolean)

Initializes an instance of the ServiceDescription class by directly loading the XML from a TextReader.

Read(XmlReader) Read(XmlReader) Read(XmlReader) Read(XmlReader)

Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

Read(XmlReader, Boolean) Read(XmlReader, Boolean) Read(XmlReader, Boolean) Read(XmlReader, Boolean)

Initializes an instance of the ServiceDescription class by directly loading the XML from an XmlReader.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Write(Stream) Write(Stream) Write(Stream) Write(Stream)

Writes out the ServiceDescription to the specified Stream.

Write(String) Write(String) Write(String) Write(String)

Writes out the ServiceDescription as a Web Services Description Language (WSDL) file to the specified path.

Write(TextWriter) Write(TextWriter) Write(TextWriter) Write(TextWriter)

Writes out the ServiceDescription as a Web Services Description Language (WSDL) file to the TextWriter.

Write(XmlWriter) Write(XmlWriter) Write(XmlWriter) Write(XmlWriter)

Writes out the ServiceDescription to the XmlWriter as a Web Services Description Language (WSDL) file.

Applies to