ServiceDescriptionCollection.GetBinding(XmlQualifiedName) 方法

定义

搜索 ServiceDescriptionCollection,然后返回具有指定名称的 Binding(它是包含在该集合中的 ServiceDescription 实例之一的成员)。

public:
 System::Web::Services::Description::Binding ^ GetBinding(System::Xml::XmlQualifiedName ^ name);
public System.Web.Services.Description.Binding GetBinding (System.Xml.XmlQualifiedName name);
member this.GetBinding : System.Xml.XmlQualifiedName -> System.Web.Services.Description.Binding
Public Function GetBinding (name As XmlQualifiedName) As Binding

参数

name
XmlQualifiedName

一个 XmlQualifiedName,其 Name 属性用于检索 Binding 实例。

返回

具有指定名称的绑定。

例外

指定的 Binding 不是集合内任何 ServiceDescription 实例的成员。

示例

// Construct an XML qualified name.
XmlQualifiedName^ myXmlQualifiedName =
   gcnew XmlQualifiedName( "MathServiceSoap","http://tempuri2.org/" );

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

// Get the Binding from the collection.
Binding myBinding = myCollection.GetBinding(myXmlQualifiedName);
' Construct an XML qualified name.
Dim myXmlQualifiedName As _
   New XmlQualifiedName("MathServiceSoap", "http://tempuri2.org/")

' Get the Binding from the collection.
Dim myBinding As Binding = _
   myCollection.GetBinding(myXmlQualifiedName)

适用于