This documentation is archived and is not being maintained.

ServiceDescriptionCollection.GetBinding Method

Searches the ServiceDescriptionCollection and returns the Binding with the specified name that is a member of one of the ServiceDescription instances contained in the collection.

[Visual Basic]
Public Function GetBinding( _
   ByVal name As XmlQualifiedName _
) As Binding
[C#]
public Binding GetBinding(
 XmlQualifiedName name
);
[C++]
public: Binding* GetBinding(
 XmlQualifiedName* name
);
[JScript]
public function GetBinding(
   name : XmlQualifiedName
) : Binding;

Parameters

name
An XmlQualifiedName whose Name property is used to retrieve a Binding instance.

Return Value

A Binding.

Exceptions

Exception Type Condition
Exception The specified Binding is not a member of any ServiceDescription instances within the collection.

Example

[Visual Basic] 
' 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)

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

[C++] 
// Construct an XML qualified name.
XmlQualifiedName* myXmlQualifiedName = 
   new XmlQualifiedName(S"MathServiceSoap", S"http://tempuri2.org/");

// Get the Binding from the collection.
myCollection->GetBinding(myXmlQualifiedName);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ServiceDescriptionCollection Class | ServiceDescriptionCollection Members | System.Web.Services.Description Namespace

Show: