OperationBindingCollection Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Představuje kolekci instancí OperationBinding třídy. Tuto třídu nelze dědit.
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
- Dědičnost
Příklady
#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
Poznámky
Třída OperationBinding odpovídá elementu WSDL (Web Services Description Language) <operation>
uzavřenému <binding>
prvkem, který zase odpovídá Binding třídě. Další informace o WSDL naleznete ve specifikaci WSDL .
Vlastnosti
Capacity |
Získá nebo nastaví počet prvků, které CollectionBase může obsahovat. (Zděděno od CollectionBase) |
Count |
Získá počet prvků obsažených v CollectionBase instanci. Tuto vlastnost nelze přepsat. (Zděděno od CollectionBase) |
InnerList |
ArrayList Získá obsahující seznam prvků v CollectionBase instanci. (Zděděno od CollectionBase) |
Item[Int32] |
Získá nebo nastaví hodnotu v OperationBinding zadaném indexu založeném na nule. |
List |
IList Získá obsahující seznam prvků v CollectionBase instanci. (Zděděno od CollectionBase) |
Table |
Získá rozhraní, které implementuje přidružení klíčů a hodnot v souboru ServiceDescriptionBaseCollection. (Zděděno od ServiceDescriptionBaseCollection) |
Metody
Add(OperationBinding) |
Přidá zadaný OperationBinding na konec .OperationBindingCollection |
Clear() |
Odebere všechny objekty z CollectionBase instance. Tuto metodu nelze přepsat. (Zděděno od CollectionBase) |
Contains(OperationBinding) |
Vrátí hodnotu označující, zda je zadaným OperationBinding členem OperationBindingCollection. |
CopyTo(OperationBinding[], Int32) |
Zkopíruje celý |
Equals(Object) |
Určí, zda se zadaný objekt rovná aktuálnímu objektu. (Zděděno od Object) |
GetEnumerator() |
Vrátí výčet, který iteruje prostřednictvím CollectionBase instance. (Zděděno od CollectionBase) |
GetHashCode() |
Slouží jako výchozí funkce hash. (Zděděno od Object) |
GetKey(Object) |
Vrátí název klíče přidruženého k hodnotě předané odkazem. (Zděděno od ServiceDescriptionBaseCollection) |
GetType() |
Type Získá aktuální instanci. (Zděděno od Object) |
IndexOf(OperationBinding) |
Vyhledá zadaný OperationBinding index a vrátí nulový index prvního výskytu v kolekci. |
Insert(Int32, OperationBinding) |
Přidá zadanou OperationBinding instanci do zadaného indexu založeného na OperationBindingCollection nule. |
MemberwiseClone() |
Vytvoří použádnou kopii aktuálního souboru Object. (Zděděno od Object) |
OnClear() |
Vymaže obsah ServiceDescriptionBaseCollection instance. (Zděděno od ServiceDescriptionBaseCollection) |
OnClearComplete() |
Provede další vlastní procesy po vymazání obsahu CollectionBase instance. (Zděděno od CollectionBase) |
OnInsert(Int32, Object) |
Před vložením nového prvku do CollectionBase instance provede další vlastní procesy. (Zděděno od CollectionBase) |
OnInsertComplete(Int32, Object) |
Provede další vlastní procesy po vložení nového prvku do ServiceDescriptionBaseCollectionsouboru . (Zděděno od ServiceDescriptionBaseCollection) |
OnRemove(Int32, Object) |
Odebere prvek z objektu ServiceDescriptionBaseCollection. (Zděděno od ServiceDescriptionBaseCollection) |
OnRemoveComplete(Int32, Object) |
Provede další vlastní procesy po odebrání elementu CollectionBase z instance. (Zděděno od CollectionBase) |
OnSet(Int32, Object, Object) |
Nahradí jednu hodnotu jinou v rámci .ServiceDescriptionBaseCollection (Zděděno od ServiceDescriptionBaseCollection) |
OnSetComplete(Int32, Object, Object) |
Provede další vlastní procesy po nastavení hodnoty v CollectionBase instanci. (Zděděno od CollectionBase) |
OnValidate(Object) |
Provádí další vlastní procesy při ověřování hodnoty. (Zděděno od CollectionBase) |
Remove(OperationBinding) |
Odebere první výskyt zadaného ze OperationBindingCollectionzadaného OperationBinding souboru . |
RemoveAt(Int32) |
Odebere prvek v zadaném indexu CollectionBase instance. Tato metoda není přepsána. (Zděděno od CollectionBase) |
SetParent(Object, Object) |
Nastaví nadřazený objekt ServiceDescriptionBaseCollection instance. (Zděděno od ServiceDescriptionBaseCollection) |
ToString() |
Vrátí řetězec, který představuje aktuální objekt. (Zděděno od Object) |
Explicitní implementace rozhraní
ICollection.CopyTo(Array, Int32) |
Zkopíruje celý CollectionBase objekt do kompatibilního jednorozměrného Array, počínaje zadaným indexem cílového pole. (Zděděno od CollectionBase) |
ICollection.IsSynchronized |
Získá hodnotu označující, zda je přístup k ho CollectionBase synchronizován (bezpečné vlákno). (Zděděno od CollectionBase) |
ICollection.SyncRoot |
Získá objekt, který lze použít k synchronizaci přístupu k CollectionBase. (Zděděno od CollectionBase) |
IList.Add(Object) |
Přidá objekt na konec objektu CollectionBase. (Zděděno od CollectionBase) |
IList.Contains(Object) |
Určuje, zda CollectionBase obsahuje konkrétní prvek. (Zděděno od CollectionBase) |
IList.IndexOf(Object) |
Vyhledá zadaný Object index a vrátí nulový index prvního výskytu v rámci celého CollectionBasesouboru . (Zděděno od CollectionBase) |
IList.Insert(Int32, Object) |
Vloží prvek do zadaného indexu CollectionBase . (Zděděno od CollectionBase) |
IList.IsFixedSize |
Získá hodnotu určující, zda CollectionBase má pevnou velikost. (Zděděno od CollectionBase) |
IList.IsReadOnly |
Získá hodnotu, která určuje, zda je CollectionBase určena jen pro čtení. (Zděděno od CollectionBase) |
IList.Item[Int32] |
Získá nebo nastaví prvek u zadaného indexu. (Zděděno od CollectionBase) |
IList.Remove(Object) |
Odebere první výskyt konkrétního objektu z objektu CollectionBase. (Zděděno od CollectionBase) |
Metody rozšíření
Cast<TResult>(IEnumerable) |
Přetypuje prvky zadaného IEnumerable typu. |
OfType<TResult>(IEnumerable) |
Filtruje prvky IEnumerable založené na zadaném typu. |
AsParallel(IEnumerable) |
Umožňuje paralelizaci dotazu. |
AsQueryable(IEnumerable) |
Převede na IEnumerable IQueryable. |