Freigeben über


ServiceDescriptionCollection.GetService-Methode

Durchsucht die ServiceDescriptionCollection und gibt den Service mit dem angegebenen Namen zurück, der ein Member einer der in der Auflistung enthaltenen ServiceDescription-Instanzen ist.

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

Syntax

'Declaration
Public Function GetService ( _
    name As XmlQualifiedName _
) As Service
'Usage
Dim instance As ServiceDescriptionCollection
Dim name As XmlQualifiedName
Dim returnValue As Service

returnValue = instance.GetService(name)
public Service GetService (
    XmlQualifiedName name
)
public:
Service^ GetService (
    XmlQualifiedName^ name
)
public Service GetService (
    XmlQualifiedName name
)
public function GetService (
    name : XmlQualifiedName
) : Service

Parameter

Rückgabewert

Ein Service.

Ausnahmen

Ausnahmetyp Bedingung

Exception

Der angegebene Service ist kein Member einer der ServiceDescription-Instanzen in der Auflistung.

Beispiel

' Construct an XML qualified name.
Dim myXmlQualifiedName As _
   New XmlQualifiedName("MathService", "http://tempuri2.org/")

' Get the Service from the collection.
Dim myService As Service = myCollection.GetService(myXmlQualifiedName)
// Construct an XML qualified name.
XmlQualifiedName myXmlQualifiedName = 
   new XmlQualifiedName("MathService", "http://tempuri2.org/");

// Get the Service from the collection.
Service myService = myCollection.GetService(myXmlQualifiedName);
// Construct an XML qualified name.
XmlQualifiedName^ myXmlQualifiedName =
   gcnew XmlQualifiedName( "MathService","http://tempuri2.org/" );

// Get the Service from the collection.
myCollection->GetService( myXmlQualifiedName );
// Construct an XML qualified name.
XmlQualifiedName myXmlQualifiedName = 
    new XmlQualifiedName("MathService", "http://tempuri2.org/");

// Get the Service from the collection.
Service myService = myCollection.GetService(myXmlQualifiedName);

Plattformen

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

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

ServiceDescriptionCollection-Klasse
ServiceDescriptionCollection-Member
System.Web.Services.Description-Namespace