This documentation is archived and is not being maintained.

Binding Class

Specifies the concrete data format and protocols used in the XML Web service. This class cannot be inherited.

For a list of all members of this type, see Binding Members.

System.Object
   System.Web.Services.Description.DocumentableItem
      System.Web.Services.Description.Binding

[Visual Basic]
NotInheritable Public Class Binding
   Inherits DocumentableItem
[C#]
public sealed class Binding : DocumentableItem
[C++]
public __gc __sealed class Binding : public DocumentableItem
[JScript]
public class Binding extends DocumentableItem

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

The Binding class corresponds to the Web Services Description Language (WSDL) <binding> element enclosed by the root <definitions> element. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.

Example

[Visual Basic, C#, C++] The following example demonstrates a typical use of the Binding class.

[Visual Basic] 
' Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings("MathServiceHttpGet")
If Not (myBinding Is Nothing) Then
   Console.WriteLine((ControlChars.Cr + ControlChars.Cr + "Name : " + myBinding.Name))
   Console.WriteLine(("Type : " + myBinding.Type.ToString()))
End If

[C#] 
// Get Binding Name = "MathServiceSoap".
myBinding = myServiceDescription.Bindings["MathServiceHttpGet"];
if (myBinding != null)
{
   Console.WriteLine("\n\nName : " + myBinding.Name);
   Console.WriteLine("Type : " + myBinding.Type);
}

[C++] 
// Get Binding Name = S"MathServiceSoap".
myBinding = myServiceDescription -> Bindings->Item[S"MathServiceHttpGet"];
if (myBinding != 0)
{
   Console::WriteLine(S"\n\nName : {0}", myBinding -> Name);
   Console::WriteLine(S"Type : {0}", myBinding -> Type);
}

[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

Namespace: System.Web.Services.Description

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

Assembly: System.Web.Services (in System.Web.Services.dll)

See Also

Binding Members | System.Web.Services.Description Namespace

Show: