OperationBindingCollection Klas

Definitie

Vertegenwoordigt een verzameling exemplaren van de OperationBinding klasse. Deze klasse kan niet worden overgenomen.

public ref class OperationBindingCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class OperationBindingCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type OperationBindingCollection = class
    inherit ServiceDescriptionBaseCollection
Public NotInheritable Class OperationBindingCollection
Inherits ServiceDescriptionBaseCollection
Overname

Voorbeelden

#using <System.Xml.dll>
#using <System.Web.Services.dll>
#using <System.dll>

using namespace System;
using namespace System::Web::Services::Description;
int main()
{
   try
   {
      ServiceDescription^ myServiceDescription = ServiceDescription::Read( "MathService_input_cpp.wsdl" );
      
      // Add the OperationBinding for the Add operation.
      OperationBinding^ addOperationBinding = gcnew OperationBinding;
      String^ addOperation = "Add";
      String^ myTargetNamespace = myServiceDescription->TargetNamespace;
      addOperationBinding->Name = addOperation;
      
      // Add the InputBinding for the operation.
      InputBinding^ myInputBinding = gcnew InputBinding;
      SoapBodyBinding^ mySoapBodyBinding = gcnew SoapBodyBinding;
      mySoapBodyBinding->Use = SoapBindingUse::Literal;
      myInputBinding->Extensions->Add( mySoapBodyBinding );
      addOperationBinding->Input = myInputBinding;
      
      // Add the OutputBinding for the operation.
      OutputBinding^ myOutputBinding = gcnew OutputBinding;
      myOutputBinding->Extensions->Add( mySoapBodyBinding );
      addOperationBinding->Output = myOutputBinding;
      
      // Add the extensibility element for the SoapOperationBinding.
      SoapOperationBinding^ mySoapOperationBinding = gcnew SoapOperationBinding;
      mySoapOperationBinding->Style = SoapBindingStyle::Document;
      mySoapOperationBinding->SoapAction = String::Concat( myTargetNamespace, addOperation );
      addOperationBinding->Extensions->Add( mySoapOperationBinding );
      
      // Get the BindingCollection from the ServiceDescription.
      BindingCollection^ myBindingCollection = myServiceDescription->Bindings;
      
      // Get the OperationBindingCollection of SOAP binding from
      // the BindingCollection.
      OperationBindingCollection^ myOperationBindingCollection = myBindingCollection[ 0 ]->Operations;
      
      // Check for the Add OperationBinding in the collection.
      bool contains = myOperationBindingCollection->Contains( addOperationBinding );
      Console::WriteLine( "\nWhether the collection contains the Add OperationBinding : {0}", contains );

      // Add the Add OperationBinding to the collection.
      myOperationBindingCollection->Add( addOperationBinding );
      Console::WriteLine( "\nAdded the OperationBinding of the Add"
      " operation to the collection." );

      // Get the OperationBinding of the Add operation from the collection.
      OperationBinding^ myOperationBinding = myOperationBindingCollection[ 3 ];

      // Remove the OperationBinding of the Add operation from
      // the collection.
      myOperationBindingCollection->Remove( myOperationBinding );
      Console::WriteLine( "\nRemoved the OperationBinding of the "
      "Add operation from the collection." );

      // Insert the OperationBinding of the Add operation at index 0.
      myOperationBindingCollection->Insert( 0, addOperationBinding );
      Console::WriteLine( "\nInserted the OperationBinding of the "
      "Add operation in the collection." );

      // Get the index of the OperationBinding of the Add
      // operation from the collection.
      int index = myOperationBindingCollection->IndexOf( addOperationBinding );
      Console::WriteLine( "\nThe index of the OperationBinding of the Add operation : {0}", index );

      Console::WriteLine( "" );
      
      array<OperationBinding^>^operationBindingArray =
            gcnew array<OperationBinding^>(myOperationBindingCollection->Count);

      // Copy this collection to the OperationBinding array.
      myOperationBindingCollection->CopyTo( operationBindingArray, 0 );
      Console::WriteLine( "The operations supported by this service "
      "are :" );

      for each(OperationBinding^ myOperationBinding1 in operationBindingArray)
      {
         Binding^ myBinding = myOperationBinding1->Binding;
         Console::WriteLine(" Binding : "+ myBinding->Name + " Name of " +
            "operation : " + myOperationBinding1->Name);
      }

      // Save the ServiceDescription to an external file.
      myServiceDescription->Write( "MathService_new_cpp.wsdl" );
   }
   catch ( Exception^ e ) 
   {
      Console::WriteLine( "Exception caught!!!" );
      Console::WriteLine( "Source : {0}", e->Source );
      Console::WriteLine( "Message : {0}", e->Message );
   }
}
using System;
using System.Web.Services.Description;

class MyOperationBindingCollectionSample
{
   static void Main()
   {
      try
      {
         ServiceDescription myServiceDescription =
            ServiceDescription.Read("MathService_input_cs.wsdl");

         // Add the OperationBinding for the Add operation.
         OperationBinding addOperationBinding = new OperationBinding();
         string addOperation = "Add";
         string myTargetNamespace = myServiceDescription.TargetNamespace;
         addOperationBinding.Name = addOperation;

         // Add the InputBinding for the operation.
         InputBinding myInputBinding = new InputBinding();
         SoapBodyBinding mySoapBodyBinding = new SoapBodyBinding();
         mySoapBodyBinding.Use = SoapBindingUse.Literal;
         myInputBinding.Extensions.Add(mySoapBodyBinding);
         addOperationBinding.Input = myInputBinding;

         // Add the OutputBinding for the operation.
         OutputBinding myOutputBinding = new OutputBinding();
         myOutputBinding.Extensions.Add(mySoapBodyBinding);
         addOperationBinding.Output = myOutputBinding;

         // Add the extensibility element for the SoapOperationBinding.
         SoapOperationBinding mySoapOperationBinding =
            new SoapOperationBinding();
         mySoapOperationBinding.Style = SoapBindingStyle.Document;
         mySoapOperationBinding.SoapAction = myTargetNamespace + addOperation;
         addOperationBinding.Extensions.Add(mySoapOperationBinding);

         // Get the BindingCollection from the ServiceDescription.
         BindingCollection myBindingCollection =
            myServiceDescription.Bindings;

         // Get the OperationBindingCollection of SOAP binding from
         // the BindingCollection.
         OperationBindingCollection myOperationBindingCollection =
            myBindingCollection[0].Operations;

         // Check for the Add OperationBinding in the collection.
         bool contains = myOperationBindingCollection.Contains
            (addOperationBinding);
         Console.WriteLine("\nWhether the collection contains the Add " +
            "OperationBinding : " + contains);

         // Add the Add OperationBinding to the collection.
         myOperationBindingCollection.Add(addOperationBinding);
         Console.WriteLine("\nAdded the OperationBinding of the Add" +
            " operation to the collection.");

         // Get the OperationBinding of the Add operation from the collection.
         OperationBinding myOperationBinding =
            myOperationBindingCollection[3];

         // Remove the OperationBinding of the Add operation from
         // the collection.
         myOperationBindingCollection.Remove(myOperationBinding);
         Console.WriteLine("\nRemoved the OperationBinding of the " +
            "Add operation from the collection.");

         // Insert the OperationBinding of the Add operation at index 0.
         myOperationBindingCollection.Insert(0, addOperationBinding);
         Console.WriteLine("\nInserted the OperationBinding of the " +
            "Add operation in the collection.");

         // Get the index of the OperationBinding of the Add
         // operation from the collection.
         int index = myOperationBindingCollection.IndexOf(addOperationBinding);
         Console.WriteLine("\nThe index of the OperationBinding of the " +
            "Add operation : " + index);
         Console.WriteLine("");

         OperationBinding[] operationBindingArray = new
            OperationBinding[myOperationBindingCollection.Count];

         // Copy this collection to the OperationBinding array.
         myOperationBindingCollection.CopyTo(operationBindingArray, 0);
         Console.WriteLine("The operations supported by this service " +
            "are :");
         foreach(OperationBinding myOperationBinding1 in
            operationBindingArray)
         {
            Binding myBinding = myOperationBinding1.Binding;
            Console.WriteLine(" Binding : "+ myBinding.Name + " Name of " +
               "operation : " + myOperationBinding1.Name);
         }

         // Save the ServiceDescription to an external file.
         myServiceDescription.Write("MathService_new_cs.wsdl");
      }
      catch(Exception e)
      {
         Console.WriteLine("Exception caught!!!");
         Console.WriteLine("Source : " + e.Source);
         Console.WriteLine("Message : " + e.Message);
      }
   }
}
Imports System.Web.Services.Description

Class MyOperationBindingCollectionSample

   Shared Sub Main()
      Try
         Dim myServiceDescription As ServiceDescription = _
            ServiceDescription.Read("MathService_input_vb.wsdl")

         ' Add the OperationBinding for the Add operation.
         Dim addOperationBinding As New OperationBinding()
         Dim addOperation As String = "Add"
         Dim myTargetNamespace As String = myServiceDescription.TargetNamespace
         addOperationBinding.Name = addOperation

         ' Add the InputBinding for the operation.
         Dim myInputBinding As New InputBinding()
         Dim mySoapBodyBinding As New SoapBodyBinding()
         mySoapBodyBinding.Use = SoapBindingUse.Literal
         myInputBinding.Extensions.Add(mySoapBodyBinding)
         addOperationBinding.Input = myInputBinding

         ' Add the OutputBinding for the operation.
         Dim myOutputBinding As New OutputBinding()
         myOutputBinding.Extensions.Add(mySoapBodyBinding)
         addOperationBinding.Output = myOutputBinding

         ' Add the extensibility element for the SoapOperationBinding.
         Dim mySoapOperationBinding As New SoapOperationBinding()
         mySoapOperationBinding.Style = SoapBindingStyle.Document
         mySoapOperationBinding.SoapAction = myTargetNamespace & addOperation
         addOperationBinding.Extensions.Add(mySoapOperationBinding)

         ' Get the BindingCollection from the ServiceDescription.
         Dim myBindingCollection As BindingCollection = _
            myServiceDescription.Bindings

         ' Get the OperationBindingCollection of SOAP binding from
         ' the BindingCollection.
         Dim myOperationBindingCollection As OperationBindingCollection = _
            myBindingCollection(0).Operations

         ' Check for the Add OperationBinding in the collection.
         Dim contains As Boolean = _
            myOperationBindingCollection.Contains(addOperationBinding)
         Console.WriteLine(ControlChars.NewLine & _
            "Whether the collection contains the Add " & _
            "OperationBinding : " & contains.ToString())

         ' Add the Add OperationBinding to the collection.
         myOperationBindingCollection.Add(addOperationBinding)
         Console.WriteLine(ControlChars.NewLine & _
            "Added the OperationBinding of the Add " & _
            "operation to the collection.")

         ' Get the OperationBinding of the Add operation from the collection.
         Dim myOperationBinding As OperationBinding = _
            myOperationBindingCollection(3)

         ' Remove the OperationBinding of the 'Add' operation from
         ' the collection.
         myOperationBindingCollection.Remove(myOperationBinding)
         Console.WriteLine(ControlChars.NewLine & _
            "Removed the OperationBinding of the " & _
            "Add operation from the collection.")
         ' Insert the OperationBinding of the Add operation at index 0.
         myOperationBindingCollection.Insert(0, addOperationBinding)
         Console.WriteLine(ControlChars.NewLine & _
            "Inserted the OperationBinding of the " & _
            "Add operation in the collection.")

         ' Get the index of the OperationBinding of the Add
         ' operation from the collection.
         Dim index As Integer = myOperationBindingCollection.IndexOf( _
            addOperationBinding)
         Console.WriteLine(ControlChars.NewLine & _
            "The index of the OperationBinding of the " & _
            "Add operation : " & index.ToString())
         Console.WriteLine("")

         Dim operationBindingArray(myOperationBindingCollection.Count -1  ) _
            As OperationBinding

         ' Copy this collection to the OperationBinding array.
         myOperationBindingCollection.CopyTo(operationBindingArray, 0)
         Console.WriteLine("The operations supported by this service " & _
            "are :")
         Dim myOperationBinding1 As OperationBinding
         For Each myOperationBinding1 In  operationBindingArray
            Dim myBinding As Binding = myOperationBinding1.Binding
            Console.WriteLine(" Binding : " & myBinding.Name & " Name of " & _
               "operation : " & myOperationBinding1.Name)
         Next myOperationBinding1

         ' Save the ServiceDescription to an external file.
         myServiceDescription.Write("MathService_new_vb.wsdl")
      Catch e As Exception
         Console.WriteLine("Exception caught!!!")
         Console.WriteLine("Source : " & e.Source.ToString())
         Console.WriteLine("Message : " & e.Message.ToString())
      End Try
   End Sub
End Class

Opmerkingen

De OperationBinding klasse komt overeen met het WSDL-element (Web Services Description Language), <operation> dat <binding> op zijn beurt overeenkomt met de Binding klasse. Zie de WSDL-specificatie voor meer informatie over WSDL.

Eigenschappen

Name Description
Capacity

Hiermee haalt u het aantal elementen op of CollectionBase stelt u dit in.

(Overgenomen van CollectionBase)
Count

Hiermee haalt u het aantal elementen op dat in het CollectionBase exemplaar is opgenomen. Deze eigenschap kan niet worden overschreven.

(Overgenomen van CollectionBase)
InnerList

Hiermee haalt u een ArrayList met de lijst met elementen in het CollectionBase exemplaar op.

(Overgenomen van CollectionBase)
Item[Int32]

Hiermee wordt de waarde van een OperationBinding op nul gebaseerde index opgehaald of ingesteld.

List

Hiermee haalt u een IList met de lijst met elementen in het CollectionBase exemplaar op.

(Overgenomen van CollectionBase)
Table

Hiermee haalt u een interface op waarmee de koppeling van de sleutels en waarden in de ServiceDescriptionBaseCollection.

(Overgenomen van ServiceDescriptionBaseCollection)

Methoden

Name Description
Add(OperationBinding)

Hiermee voegt u de opgegeven OperationBinding waarde toe aan het einde van de OperationBindingCollection.

Clear()

Hiermee verwijdert u alle objecten uit het CollectionBase exemplaar. Deze methode kan niet worden overschreven.

(Overgenomen van CollectionBase)
Contains(OperationBinding)

Retourneert een waarde die aangeeft of de opgegeven OperationBinding lid is van de OperationBindingCollection.

CopyTo(OperationBinding[], Int32)

Kopieert het hele OperationBindingCollection naar een compatibele eendimensionale matrix van het type OperationBinding, beginnend bij de opgegeven op nul gebaseerde index van de doelmatrix.

Equals(Object)

Bepaalt of het opgegeven object gelijk is aan het huidige object.

(Overgenomen van Object)
GetEnumerator()

Retourneert een enumerator die door het CollectionBase exemplaar wordt herhaald.

(Overgenomen van CollectionBase)
GetHashCode()

Fungeert als de standaardhashfunctie.

(Overgenomen van Object)
GetKey(Object)

Retourneert de naam van de sleutel die is gekoppeld aan de waarde die is doorgegeven door verwijzing.

(Overgenomen van ServiceDescriptionBaseCollection)
GetType()

Hiermee haalt u de Type huidige instantie op.

(Overgenomen van Object)
IndexOf(OperationBinding)

Zoekt naar de opgegeven OperationBinding en retourneert de op nul gebaseerde index van het eerste exemplaar in de verzameling.

Insert(Int32, OperationBinding)

Hiermee voegt u het opgegeven OperationBinding exemplaar toe aan de OperationBindingCollection opgegeven op nul gebaseerde index.

MemberwiseClone()

Hiermee maakt u een ondiepe kopie van de huidige Object.

(Overgenomen van Object)
OnClear()

Hiermee wist u de inhoud van het ServiceDescriptionBaseCollection exemplaar.

(Overgenomen van ServiceDescriptionBaseCollection)
OnClearComplete()

Voert extra aangepaste processen uit nadat de inhoud van het CollectionBase exemplaar is gewist.

(Overgenomen van CollectionBase)
OnInsert(Int32, Object)

Voert aanvullende aangepaste processen uit voordat u een nieuw element in het CollectionBase exemplaar invoegt.

(Overgenomen van CollectionBase)
OnInsertComplete(Int32, Object)

Voert extra aangepaste processen uit na het invoegen van een nieuw element in de ServiceDescriptionBaseCollection.

(Overgenomen van ServiceDescriptionBaseCollection)
OnRemove(Int32, Object)

Hiermee verwijdert u een element uit de ServiceDescriptionBaseCollection.

(Overgenomen van ServiceDescriptionBaseCollection)
OnRemoveComplete(Int32, Object)

Voert extra aangepaste processen uit nadat u een element uit het CollectionBase exemplaar hebt verwijderd.

(Overgenomen van CollectionBase)
OnSet(Int32, Object, Object)

Vervangt de ene waarde door een andere waarde in de ServiceDescriptionBaseCollection.

(Overgenomen van ServiceDescriptionBaseCollection)
OnSetComplete(Int32, Object, Object)

Voert extra aangepaste processen uit na het instellen van een waarde in het CollectionBase exemplaar.

(Overgenomen van CollectionBase)
OnValidate(Object)

Voert extra aangepaste processen uit bij het valideren van een waarde.

(Overgenomen van CollectionBase)
Remove(OperationBinding)

Hiermee verwijdert u het eerste exemplaar van de opgegeven OperationBinding instantie uit de OperationBindingCollection.

RemoveAt(Int32)

Hiermee verwijdert u het element in de opgegeven index van het CollectionBase exemplaar. Deze methode kan niet worden overschreven.

(Overgenomen van CollectionBase)
SetParent(Object, Object)

Hiermee stelt u het bovenliggende object van het ServiceDescriptionBaseCollection exemplaar in.

(Overgenomen van ServiceDescriptionBaseCollection)
ToString()

Retourneert een tekenreeks die het huidige object vertegenwoordigt.

(Overgenomen van Object)

Expliciete interface-implementaties

Name Description
ICollection.CopyTo(Array, Int32)

Kopieert het hele CollectionBase naar een compatibele eendimensionale Arraywaarde, beginnend bij de opgegeven index van de doelmatrix.

(Overgenomen van CollectionBase)
ICollection.IsSynchronized

Hiermee wordt een waarde opgehaald die aangeeft of de toegang tot de CollectionBase synchronisatie is gesynchroniseerd (thread safe).

(Overgenomen van CollectionBase)
ICollection.SyncRoot

Hiermee haalt u een object op dat kan worden gebruikt om de toegang tot het CollectionBaseobject te synchroniseren.

(Overgenomen van CollectionBase)
IList.Add(Object)

Hiermee voegt u een object toe aan het einde van de CollectionBase.

(Overgenomen van CollectionBase)
IList.Contains(Object)

Bepaalt of het CollectionBase een specifiek element bevat.

(Overgenomen van CollectionBase)
IList.IndexOf(Object)

Zoekt naar de opgegeven Object en retourneert de op nul gebaseerde index van het eerste exemplaar binnen het hele CollectionBaseexemplaar.

(Overgenomen van CollectionBase)
IList.Insert(Int32, Object)

Hiermee voegt u een element in de CollectionBase opgegeven index in.

(Overgenomen van CollectionBase)
IList.IsFixedSize

Hiermee wordt een waarde opgehaald die aangeeft of de grootte van een CollectionBase vaste grootte is.

(Overgenomen van CollectionBase)
IList.IsReadOnly

Hiermee wordt een waarde opgehaald die aangeeft of het CollectionBase kenmerk Alleen-lezen is.

(Overgenomen van CollectionBase)
IList.Item[Int32]

Hiermee haalt u het element op de opgegeven index op of stelt u het in.

(Overgenomen van CollectionBase)
IList.Remove(Object)

Hiermee verwijdert u het eerste exemplaar van een specifiek object uit de CollectionBase.

(Overgenomen van CollectionBase)

Extensiemethoden

Name Description
AsParallel(IEnumerable)

Hiermee schakelt u parallelle uitvoering van een query in.

AsQueryable(IEnumerable)

Converteert een IEnumerable naar een IQueryable.

Cast<TResult>(IEnumerable)

Cast de elementen van een IEnumerable naar het opgegeven type.

OfType<TResult>(IEnumerable)

Hiermee filtert u de elementen van een IEnumerable op basis van een opgegeven type.

Van toepassing op