ServiceDescriptionCollection.GetService(XmlQualifiedName) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
搜尋 ServiceDescriptionCollection 並傳回具有指定名稱的 Service,其為包含在集合中的其中一個 ServiceDescription 執行個體的成員。
public:
System::Web::Services::Description::Service ^ GetService(System::Xml::XmlQualifiedName ^ name);
public System.Web.Services.Description.Service GetService (System.Xml.XmlQualifiedName name);
member this.GetService : System.Xml.XmlQualifiedName -> System.Web.Services.Description.Service
Public Function GetService (name As XmlQualifiedName) As Service
參數
- name
- XmlQualifiedName
XmlQualifiedName,以傳址方式傳遞它,其 Name 屬性由傳回的 Service 共用。
傳回
具有指定的名稱的服務。
例外狀況
指定的 Service
不是集合內任何 ServiceDescription 執行個體的成員。
範例
// 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);
' 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)