OperationMessageCollection Kelas
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mewakili kumpulan OperationInput dan OperationOutput pesan yang terkait dengan layanan Web XML. Kelas ini tidak dapat diwariskan.
public ref class OperationMessageCollection sealed : System::Web::Services::Description::ServiceDescriptionBaseCollection
public sealed class OperationMessageCollection : System.Web.Services.Description.ServiceDescriptionBaseCollection
type OperationMessageCollection = class
inherit ServiceDescriptionBaseCollection
Public NotInheritable Class OperationMessageCollection
Inherits ServiceDescriptionBaseCollection
- Warisan
Contoh
#using <System.dll>
#using <System.Web.Services.dll>
#using <System.Xml.dll>
using namespace System;
using namespace System::Xml;
using namespace System::Web::Services;
using namespace System::Web::Services::Description;
// Displays the properties of the OperationMessageCollection.
void DisplayFlowInputOutput( OperationMessageCollection^ myOperationMessageCollection, String^ myOperation )
{
Console::WriteLine( "After {0}:", myOperation );
Console::WriteLine( "Flow : {0}", myOperationMessageCollection->Flow );
Console::WriteLine( "The first occurrence of operation Input in the collection {0}", myOperationMessageCollection->Input );
Console::WriteLine( "The first occurrence of operation Output in the collection {0}", myOperationMessageCollection->Output );
Console::WriteLine();
}
int main()
{
try
{
ServiceDescription^ myDescription = ServiceDescription::Read( "MathService_input_cs.wsdl" );
PortTypeCollection^ myPortTypeCollection = myDescription->PortTypes;
// Get the OperationCollection for the SOAP protocol.
OperationCollection^ myOperationCollection = myPortTypeCollection[ 0 ]->Operations;
// Get the OperationMessageCollection for the Add operation.
OperationMessageCollection^ myOperationMessageCollection = myOperationCollection[ 0 ]->Messages;
// Display the Flow, Input, and Output properties.
DisplayFlowInputOutput( myOperationMessageCollection, "Start" );
// Get the operation message for the Add operation.
OperationMessage^ myOperationMessage = myOperationMessageCollection[ 0 ];
OperationMessage^ myInputOperationMessage = dynamic_cast<OperationMessage^>(gcnew OperationInput);
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
myInputOperationMessage->Message = myXmlQualifiedName;
array<OperationMessage^>^myCollection = gcnew array<OperationMessage^>(myOperationMessageCollection->Count);
myOperationMessageCollection->CopyTo( myCollection, 0 );
Console::WriteLine( "Operation name(s) :" );
for ( int i = 0; i < myCollection->Length; i++ )
{
Console::WriteLine( " {0}", myCollection[ i ]->Operation->Name );
}
// Add the OperationMessage to the collection.
myOperationMessageCollection->Add( myInputOperationMessage );
DisplayFlowInputOutput( myOperationMessageCollection, "Add" );
if ( myOperationMessageCollection->Contains( myOperationMessage ))
{
int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage );
Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex );
}
myOperationMessageCollection->Remove( myInputOperationMessage );
// Display Flow, Input, and Output after removing.
DisplayFlowInputOutput( myOperationMessageCollection, "Remove" );
// Insert the message at index 0 in the collection.
myOperationMessageCollection->Insert( 0, myInputOperationMessage );
// Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput( myOperationMessageCollection, "Insert" );
myDescription->Write( "MathService_new_cs.wsdl" );
}
catch ( Exception^ e )
{
Console::WriteLine( "Exception caught!!!" );
Console::WriteLine( "Source : {0}", e->Source );
Console::WriteLine( "Message : {0}", e->Message );
}
}
using System;
using System.Xml;
using System.Web.Services;
using System.Web.Services.Description;
class MyOperationMessageCollectionSample
{
static void Main()
{
try
{
ServiceDescription myDescription =
ServiceDescription.Read("MathService_input_cs.wsdl");
PortTypeCollection myPortTypeCollection =
myDescription.PortTypes;
// Get the OperationCollection for the SOAP protocol.
OperationCollection myOperationCollection =
myPortTypeCollection[0].Operations;
// Get the OperationMessageCollection for the Add operation.
OperationMessageCollection myOperationMessageCollection =
myOperationCollection[0].Messages;
// Display the Flow, Input, and Output properties.
DisplayFlowInputOutput(myOperationMessageCollection, "Start");
// Get the operation message for the Add operation.
OperationMessage myOperationMessage =
myOperationMessageCollection[0];
OperationMessage myInputOperationMessage =
(OperationMessage) new OperationInput();
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
"AddSoapIn", myDescription.TargetNamespace);
myInputOperationMessage.Message = myXmlQualifiedName;
OperationMessage[] myCollection =
new OperationMessage[myOperationMessageCollection.Count];
myOperationMessageCollection.CopyTo(myCollection, 0);
Console.WriteLine("Operation name(s) :");
for (int i = 0; i < myCollection.Length ; i++)
{
Console.WriteLine(" " + myCollection[i].Operation.Name);
}
// Add the OperationMessage to the collection.
myOperationMessageCollection.Add(myInputOperationMessage);
DisplayFlowInputOutput(myOperationMessageCollection, "Add");
if(myOperationMessageCollection.Contains(myOperationMessage))
{
int myIndex =
myOperationMessageCollection.IndexOf(myOperationMessage);
Console.WriteLine(" The index of the Add operation " +
"message in the collection is : " + myIndex);
}
myOperationMessageCollection.Remove(myInputOperationMessage);
// Display Flow, Input, and Output after removing.
DisplayFlowInputOutput(myOperationMessageCollection, "Remove");
// Insert the message at index 0 in the collection.
myOperationMessageCollection.Insert(0, myInputOperationMessage);
// Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput(myOperationMessageCollection, "Insert");
myDescription.Write("MathService_new_cs.wsdl");
}
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
}
// Displays the properties of the OperationMessageCollection.
public static void DisplayFlowInputOutput( OperationMessageCollection
myOperationMessageCollection, string myOperation)
{
Console.WriteLine("After " + myOperation + ":");
Console.WriteLine("Flow : " + myOperationMessageCollection.Flow);
Console.WriteLine("The first occurrence of operation Input " +
"in the collection " + myOperationMessageCollection.Input);
Console.WriteLine("The first occurrence of operation Output " +
"in the collection " + myOperationMessageCollection.Output);
Console.WriteLine();
}
}
Imports System.Xml
Imports System.Web.Services
Imports System.Web.Services.Description
Class MyOperationMessageCollectionSample
Shared Sub Main()
Try
Dim myDescription As ServiceDescription = _
ServiceDescription.Read("MathService_input_vb.wsdl")
Dim myPortTypeCollection As PortTypeCollection = _
myDescription.PortTypes
' Get the OperationCollection for the SOAP protocol.
Dim myOperationCollection As OperationCollection = _
myPortTypeCollection(0).Operations
' Get the OperationMessageCollection for the Add operation.
Dim myOperationMessageCollection As OperationMessageCollection = _
myOperationCollection(0).Messages
' Display the Flow, Input, and Output properties.
DisplayFlowInputOutput(myOperationMessageCollection, "Start")
' Get the operation message for the Add operation.
Dim myOperationMessage As OperationMessage = _
myOperationMessageCollection.Item(0)
Dim myInputOperationMessage As OperationMessage = _
CType(New OperationInput(), OperationMessage)
Dim myXmlQualifiedName As _
New XmlQualifiedName("AddSoapIn", myDescription.TargetNamespace)
myInputOperationMessage.Message = myXmlQualifiedName
Dim myCollection(myOperationMessageCollection.Count -1 ) _
As OperationMessage
myOperationMessageCollection.CopyTo(myCollection, 0)
Console.WriteLine("Operation name(s) :")
Dim i As Integer
For i = 0 To myCollection.Length - 1
Console.WriteLine(" " & myCollection(i).Operation.Name)
Next i
' Add the OperationMessage to the collection.
myOperationMessageCollection.Add(myInputOperationMessage)
DisplayFlowInputOutput(myOperationMessageCollection, "Add")
If myOperationMessageCollection.Contains(myOperationMessage) _
= True Then
Dim myIndex As Integer = _
myOperationMessageCollection.IndexOf(myOperationMessage)
Console.WriteLine(" The index of the Add operation " & _
"message in the collection is : " & myIndex.ToString())
End If
myOperationMessageCollection.Remove(myInputOperationMessage)
' Display Flow, Input, and Output after removing.
DisplayFlowInputOutput(myOperationMessageCollection, "Remove")
' Insert the message at index 0 in the collection.
myOperationMessageCollection.Insert(0, myInputOperationMessage)
' Display Flow, Input, and Output after inserting.
DisplayFlowInputOutput(myOperationMessageCollection, "Insert")
myDescription.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
' Displays the properties of the OperationMessageCollection.
Public Shared Sub DisplayFlowInputOutput(myOperationMessageCollection As _
OperationMessageCollection, myOperation As String)
Console.WriteLine("After " & myOperation.ToString() & ":")
Console.WriteLine("Flow : " & _
myOperationMessageCollection.Flow.ToString())
Console.WriteLine("The first occurrence of operation Input " & _
"in the collection {0}" , myOperationMessageCollection.Input)
Console.WriteLine("The first occurrence of operation Output " & _
"in the collection " & myOperationMessageCollection.Output.ToString())
Console.WriteLine()
End Sub
End Class
Keterangan
Instans kelas ini akan dikembalikan oleh Messages properti induk Operation. Dengan demikian, ia dapat memiliki tepat dua anggota, satu OperationInput dan yang lainnya OperationOutput.
Properti
| Nama | Deskripsi |
|---|---|
| Capacity |
Mendapatkan atau mengatur jumlah elemen yang dapat dikandung CollectionBase . (Diperoleh dari CollectionBase) |
| Count |
Mendapatkan jumlah elemen yang terkandung dalam CollectionBase instans. Properti ini tidak dapat ditimpa. (Diperoleh dari CollectionBase) |
| Flow |
Mendapatkan jenis transmisi yang didukung oleh OperationMessageCollection. |
| InnerList |
Mendapatkan yang ArrayList berisi daftar elemen dalam CollectionBase instans. (Diperoleh dari CollectionBase) |
| Input |
Mendapatkan kemunculan pertama dari sebuah OperationInput dalam koleksi. |
| Item[Int32] |
Mendapatkan atau menetapkan nilai pada OperationMessage indeks berbasis nol yang ditentukan. |
| List |
Mendapatkan yang IList berisi daftar elemen dalam CollectionBase instans. (Diperoleh dari CollectionBase) |
| Output |
Mendapatkan kemunculan pertama dari sebuah OperationOutput dalam koleksi. |
| Table |
Mendapatkan antarmuka yang mengimplementasikan asosiasi kunci dan nilai dalam ServiceDescriptionBaseCollection. (Diperoleh dari ServiceDescriptionBaseCollection) |
Metode
| Nama | Deskripsi |
|---|---|
| Add(OperationMessage) |
Menambahkan yang ditentukan OperationMessage ke akhir OperationMessageCollection. |
| Clear() |
Menghapus semua objek dari CollectionBase instans. Metode ini tidak dapat ditimpa. (Diperoleh dari CollectionBase) |
| Contains(OperationMessage) |
Menentukan apakah yang ditentukan OperationMessage adalah anggota dari OperationMessageCollection. |
| CopyTo(OperationMessage[], Int32) |
Menyalin seluruh OperationMessageCollection ke array OperationMessagejenis 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(OperationMessage) |
Mencari yang ditentukan OperationMessage dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam koleksi. |
| Insert(Int32, OperationMessage) |
Menambahkan yang ditentukan OperationMessage ke OperationMessageCollection 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(OperationMessage) |
Menghapus kemunculan pertama dari yang ditentukan OperationMessage dari OperationMessageCollection. |
| 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 yang ditentukan Object dan mengembalikan indeks berbasis nol dari kemunculan pertama dalam seluruh CollectionBase. (Diperoleh dari CollectionBase) |
| IList.Insert(Int32, Object) |
Menyisipkan elemen ke CollectionBase dalam 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. |