ServiceDescription Třída

Definice

Poskytuje prostředky pro vytvoření a formátování platného souboru dokumentu WSDL (Web Services Description Language), který je kompletní s příslušnými obory názvů, prvky a atributy pro popis webové služby XML. Tato třída se nemůže dědit.

public ref class ServiceDescription sealed : System::Web::Services::Description::DocumentableItem
public ref class ServiceDescription sealed : System::Web::Services::Description::NamedItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class ServiceDescription : System.Web.Services.Description.DocumentableItem
[System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")]
public sealed class ServiceDescription : System.Web.Services.Description.NamedItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type ServiceDescription = class
    inherit DocumentableItem
[<System.Web.Services.Configuration.XmlFormatExtensionPoint("Extensions")>]
type ServiceDescription = class
    inherit NamedItem
Public NotInheritable Class ServiceDescription
Inherits DocumentableItem
Public NotInheritable Class ServiceDescription
Inherits NamedItem
Dědičnost
ServiceDescription
Dědičnost
ServiceDescription
Atributy

Příklady

Následující příklad ukazuje, jak vytvořit instanci ServiceDescription třídy.

// 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")

Poznámky

Instance této třídy lze vytvořit pomocí klíčového new slova nebo statické Read metody, která parsuje soubor WSDL a přiřadí jeho hodnoty příslušným členům třídy.

WSDL je jazyk založený na jazyce XML pro popis webových služeb XML. Třída ServiceDescription odpovídá kořenovému elementu , definitionssouboru WSDL. Další informace o WSDL naleznete ve specifikaci WSDL .

Konstruktory

Name Description
ServiceDescription()

Inicializuje novou instanci ServiceDescription třídy.

Pole

Name Description
Namespace

Obor názvů XML, ve kterém ServiceDescription je třída definována ("http://schemas.xmlsoap.org/wsdl/")" Toto pole je konstantní.

Vlastnosti

Name Description
Bindings

Získá kolekci prvků obsažených Binding v ServiceDescription.

Documentation

Získá nebo nastaví textovou dokumentaci pro instanci DocumentableItem.

(Zděděno od DocumentableItem)
DocumentationElement

Získá nebo nastaví prvek dokumentace pro DocumentableItem.

(Zděděno od DocumentableItem)
ExtensibleAttributes

Získá nebo nastaví pole typu XmlAttribute , který představuje rozšíření atributů WSDL pro zajištění souladu s webovými službami interoperability (WS-I) Základní profil 1.1.

(Zděděno od DocumentableItem)
Extensions

Získá kolekci prvků rozšiřitelnosti obsažených ServiceDescriptionv .

Imports

Získá kolekci prvků obsažených Import v ServiceDescription.

Messages

Získá kolekci prvků obsažených Message v ServiceDescription.

Name

Získá nebo nastaví atribut descriptions názvu XML značky ohraničující soubor WSDL (Web Services Description Language).

Name

Získá nebo nastaví název položky.

(Zděděno od NamedItem)
Namespaces

Získá nebo nastaví slovník předpon oboru názvů a oborů názvů použitých k zachování předpon oboru názvů a oborů názvů při vytváření objektu ServiceDescription .

(Zděděno od DocumentableItem)
PortTypes

Získá kolekci prvků obsažených PortType v ServiceDescription.

RetrievalUrl

Získá nebo nastaví adresu URL webové služby XML, na kterou ServiceDescription se instance vztahuje.

Schema

Získá schéma přidružené k tomuto ServiceDescription.

Serializer

Získá XML serializátor použitý k serializaci a deserializaci mezi ServiceDescription objektu a Web Services Description Language (WSDL) dokumentu.

ServiceDescriptions

ServiceDescriptionCollection Získá instanci, z níž ServiceDescription je člen.

Services

Získá kolekci Service instancí obsažených v ServiceDescription.

TargetNamespace

Získá nebo nastaví XML targetNamespace atribut descriptions značky ohraničující soubor WSDL (Web Services Description Language).

Types

Získá nebo nastaví Types obsažené ServiceDescriptionv .

ValidationWarnings

StringCollection Získá, který obsahuje jakékoli ověřovací upozornění, které byly generovány během volání Read(Stream, Boolean), Read(TextReader, Boolean), Read(String, Boolean)nebo Read(XmlReader, Boolean) s parametr nastavena validate na true.

Metody

Name Description
CanRead(XmlReader)

Získá hodnotu, která označuje, zda XmlReader představuje platný soubor WSDL (Web Services Description Language), který lze analyzovat.

Equals(Object)

Určuje, zda je zadaný objekt roven aktuálnímu objektu.

(Zděděno od Object)
GetHashCode()

Slouží jako výchozí funkce hash.

(Zděděno od Object)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
Read(Stream, Boolean)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z Stream instance.

Read(Stream)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z Stream instance.

Read(String, Boolean)

Inicializuje instanci objektu ServiceDescription přímým načtením XML ze zadaného souboru.

Read(String)

Inicializuje instanci objektu ServiceDescription přímým načtením XML ze zadaného souboru.

Read(TextReader, Boolean)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z objektu TextReader.

Read(TextReader)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z objektu TextReader.

Read(XmlReader, Boolean)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z objektu XmlReader.

Read(XmlReader)

Inicializuje instanci ServiceDescription třídy přímým načtením XML z objektu XmlReader.

ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)
Write(Stream)

ServiceDescription Zapíše do zadaného Stream.

Write(String)

ServiceDescription Zapíše soubor WSDL (Web Services Description Language) do zadané cesty.

Write(TextWriter)

ServiceDescription Zapíše do souboru TextWriterWSDL (Web Services Description Language) soubor .

Write(XmlWriter)

ServiceDescription Zapíše soubor XmlWriter WSDL (Web Services Description Language).

Platí pro