Bahasa

OperationBindingCollection Kelas

Definisi

Mewakili kumpulan instans OperationBinding kelas. Kelas ini tidak dapat diwariskan.

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
Warisan

Contoh

#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

Keterangan

Kelas OperationBinding sesuai dengan elemen Web Services Description Language (WSDL) <operation> yang diapit oleh <binding> elemen , yang pada gilirannya Binding sesuai dengan kelas . Untuk informasi selengkapnya tentang WSDL, lihat spesifikasi WSDL .

Properti

Nama Deskripsi
Capacity

Mendapatkan atau mengatur jumlah elemen yang dapat dimuat CollectionBase.

(Diperoleh dari CollectionBase)
Count

Mendapatkan jumlah elemen yang terkandung dalam CollectionBase instans. Properti ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
InnerList

Mendapatkan yang ArrayList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
Item[Int32]

Mendapatkan atau menetapkan nilai pada OperationBinding indeks berbasis nol yang ditentukan.

List

Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
Table

Mendapatkan antarmuka yang mengimplementasikan asosiasi kunci dan nilai dalam ServiceDescriptionBaseCollection.

(Diperoleh dari ServiceDescriptionBaseCollection)

Metode

Nama Deskripsi
Add(OperationBinding)

Menambahkan yang ditentukan OperationBinding ke akhir OperationBindingCollection.

Clear()

Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa.

(Diperoleh dari CollectionBase)
Contains(OperationBinding)

Mengembalikan nilai yang menunjukkan apakah yang ditentukan OperationBinding adalah anggota .OperationBindingCollection

CopyTo(OperationBinding[], Int32)

Menyalin seluruh OperationBindingCollection ke array OperationBindingjenis satu dimensi yang kompatibel , dimulai pada indeks berbasis nol yang ditentukan dari array target.

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetEnumerator()

Mengembalikan enumerator yang melakukan iterasi melalui CollectionBase instans.

(Diperoleh dari CollectionBase)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetKey(Object)

Mengembalikan nama kunci yang terkait dengan nilai yang diteruskan oleh referensi.

(Diperoleh dari ServiceDescriptionBaseCollection)
GetType()

Mendapatkan Type instans saat ini.

(Diperoleh dari Object)
IndexOf(OperationBinding)

Mencari yang ditentukan OperationBinding dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam koleksi.

Insert(Int32, OperationBinding)

Menambahkan instans yang ditentukan OperationBinding ke OperationBindingCollection pada indeks berbasis nol yang ditentukan.

MemberwiseClone()

Membuat salinan dangkal dari Objectsaat ini.

(Diperoleh dari Object)
OnClear()

Menghapus konten instans ServiceDescriptionBaseCollection .

(Diperoleh dari ServiceDescriptionBaseCollection)
OnClearComplete()

Melakukan proses kustom tambahan setelah menghapus konten instans CollectionBase .

(Diperoleh dari CollectionBase)
OnInsert(Int32, Object)

Melakukan proses kustom tambahan sebelum memasukkan elemen baru ke CollectionBase dalam instans.

(Diperoleh dari CollectionBase)
OnInsertComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menyisipkan elemen baru ke ServiceDescriptionBaseCollectiondalam .

(Diperoleh dari ServiceDescriptionBaseCollection)
OnRemove(Int32, Object)

Menghapus elemen dari ServiceDescriptionBaseCollection.

(Diperoleh dari ServiceDescriptionBaseCollection)
OnRemoveComplete(Int32, Object)

Melakukan proses kustom tambahan setelah menghapus elemen dari CollectionBase instans.

(Diperoleh dari CollectionBase)
OnSet(Int32, Object, Object)

Mengganti satu nilai dengan nilai lain dalam ServiceDescriptionBaseCollection.

(Diperoleh dari ServiceDescriptionBaseCollection)
OnSetComplete(Int32, Object, Object)

Melakukan proses kustom tambahan setelah menetapkan nilai dalam CollectionBase instans.

(Diperoleh dari CollectionBase)
OnValidate(Object)

Melakukan proses kustom tambahan saat memvalidasi nilai.

(Diperoleh dari CollectionBase)
Remove(OperationBinding)

Menghapus kemunculan pertama dari yang ditentukan OperationBinding dari OperationBindingCollection.

RemoveAt(Int32)

Menghapus elemen pada indeks instans yang CollectionBase ditentukan. Metode ini tidak dapat diganti.

(Diperoleh dari CollectionBase)
SetParent(Object, Object)

Mengatur objek ServiceDescriptionBaseCollection induk instans.

(Diperoleh dari ServiceDescriptionBaseCollection)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

Nama Deskripsi
ICollection.CopyTo(Array, Int32)

Menyalin seluruh CollectionBase ke satu dimensi Arrayyang kompatibel , dimulai pada indeks array target yang ditentukan.

(Diperoleh dari CollectionBase)
ICollection.IsSynchronized

Mendapatkan nilai yang menunjukkan apakah akses ke CollectionBase disinkronkan (utas aman).

(Diperoleh dari CollectionBase)
ICollection.SyncRoot

Mendapatkan objek yang dapat digunakan untuk menyinkronkan akses ke CollectionBase.

(Diperoleh dari CollectionBase)
IList.Add(Object)

Menambahkan objek ke akhir CollectionBase.

(Diperoleh dari CollectionBase)
IList.Contains(Object)

Menentukan apakah CollectionBase berisi elemen tertentu.

(Diperoleh dari CollectionBase)
IList.IndexOf(Object)

Mencari Object yang ditentukan dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam seluruh CollectionBase.

(Diperoleh dari CollectionBase)
IList.Insert(Int32, Object)

Menyisipkan elemen ke dalam CollectionBase pada indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.IsFixedSize

Mendapatkan nilai yang menunjukkan apakah CollectionBase memiliki ukuran tetap.

(Diperoleh dari CollectionBase)
IList.IsReadOnly

Mendapatkan nilai yang menunjukkan apakah CollectionBase bersifat baca-saja.

(Diperoleh dari CollectionBase)
IList.Item[Int32]

Mendapatkan atau mengatur elemen pada indeks yang ditentukan.

(Diperoleh dari CollectionBase)
IList.Remove(Object)

Menghapus kemunculan pertama objek tertentu dari CollectionBase.

(Diperoleh dari CollectionBase)

Metode Ekstensi

Nama Deskripsi
AsParallel(IEnumerable)

Mengaktifkan paralelisasi kueri.

AsQueryable(IEnumerable)

Mengonversi IEnumerable menjadi IQueryable.

Cast<TResult>(IEnumerable)

Melemparkan elemen IEnumerable ke jenis yang ditentukan.

OfType<TResult>(IEnumerable)

Memfilter elemen IEnumerable berdasarkan jenis tertentu.

Berlaku untuk