OperationMessageCollection Sınıf
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
XML Web hizmetiyle OperationInput ilgili bir ve OperationOutput iletileri koleksiyonunu temsil eder. Bu sınıf devralınamaz.
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
- Devralma
Örnekler
#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
Açıklamalar
Bu sınıfın bir örneği, üst Operationöğesinin Messages özelliği tarafından döndürülür. Bu nedenle, biri bir OperationInput ve diğeri OperationOutputbir olmak üzere tam olarak iki üyesi olabilir.
Özellikler
| Name | Description |
|---|---|
| Capacity |
öğesinin içerebileceği öğe CollectionBase sayısını alır veya ayarlar. (Devralındığı yer: CollectionBase) |
| Count |
Örnekte bulunan CollectionBase öğe sayısını alır. Bu özellik geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| Flow |
tarafından OperationMessageCollectiondesteklenen iletim türünü alır. |
| InnerList |
Örnekteki öğelerin ArrayList listesini içeren bir CollectionBase alır. (Devralındığı yer: CollectionBase) |
| Input |
Bir öğesinin OperationInput koleksiyondaki ilk oluşumunu alır. |
| Item[Int32] |
Belirtilen sıfır tabanlı dizinde değerini OperationMessage alır veya ayarlar. |
| List |
Örnekteki öğelerin IList listesini içeren bir CollectionBase alır. (Devralındığı yer: CollectionBase) |
| Output |
Bir öğesinin OperationOutput koleksiyondaki ilk oluşumunu alır. |
| Table |
içindeki anahtarların ve değerlerin ServiceDescriptionBaseCollectionilişkilendirmesini uygulayan bir arabirim alır. (Devralındığı yer: ServiceDescriptionBaseCollection) |
Yöntemler
| Name | Description |
|---|---|
| Add(OperationMessage) |
Belirtilen OperationMessageOperationMessageCollectiondeğerini sonuna ekler. |
| Clear() |
Örnekteki CollectionBase tüm nesneleri kaldırır. Bu yöntem geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| Contains(OperationMessage) |
Belirtilen OperationMessage öğesinin öğesinin üyesi OperationMessageCollectionolup olmadığını belirler. |
| CopyTo(OperationMessage[], Int32) |
Hedef dizinin belirtilen sıfır tabanlı dizininden başlayarak, tamamını OperationMessageCollection türündeki OperationMessageuyumlu bir tek boyutlu diziye kopyalar. |
| Equals(Object) |
Belirtilen nesnenin geçerli nesneye eşit olup olmadığını belirler. (Devralındığı yer: Object) |
| GetEnumerator() |
Örnekte yineleyen CollectionBase bir numaralandırıcı döndürür. (Devralındığı yer: CollectionBase) |
| GetHashCode() |
Varsayılan karma işlevi işlevi görür. (Devralındığı yer: Object) |
| GetKey(Object) |
Başvuru tarafından geçirilen değerle ilişkili anahtarın adını döndürür. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| GetType() |
Geçerli örneğin Type alır. (Devralındığı yer: Object) |
| IndexOf(OperationMessage) |
Belirtilen OperationMessage öğesini arar ve koleksiyondaki ilk oluşumun sıfır tabanlı dizinini döndürür. |
| Insert(Int32, OperationMessage) |
Belirtilen OperationMessageOperationMessageCollection değerini belirtilen sıfır tabanlı dizine ekler. |
| MemberwiseClone() |
Geçerli Objectbasit bir kopyasını oluşturur. (Devralındığı yer: Object) |
| OnClear() |
Örneğin içeriğini ServiceDescriptionBaseCollection temizler. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| OnClearComplete() |
Örneğin içeriğini CollectionBase temizledikten sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnInsert(Int32, Object) |
Örneğe yeni bir öğe CollectionBase eklemeden önce ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnInsertComplete(Int32, Object) |
içine ServiceDescriptionBaseCollectionyeni bir öğe ekledikten sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| OnRemove(Int32, Object) |
öğesinden ServiceDescriptionBaseCollectionöğesini kaldırır. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| OnRemoveComplete(Int32, Object) |
Bir öğeyi örnekten CollectionBase kaldırdıktan sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnSet(Int32, Object, Object) |
içindeki ServiceDescriptionBaseCollectionbir değeri başka bir değerle değiştirir. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| OnSetComplete(Int32, Object, Object) |
Örnekte bir değer CollectionBase ayarladıktan sonra ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| OnValidate(Object) |
Bir değeri doğrularken ek özel işlemler gerçekleştirir. (Devralındığı yer: CollectionBase) |
| Remove(OperationMessage) |
belirtilen OperationMessage öğesinin ilk oluşumunu içinden OperationMessageCollectionkaldırır. |
| RemoveAt(Int32) |
Örneğin belirtilen dizinindeki CollectionBase öğesini kaldırır. Bu yöntem geçersiz kılınamaz. (Devralındığı yer: CollectionBase) |
| SetParent(Object, Object) |
Örneğin üst nesnesini ServiceDescriptionBaseCollection ayarlar. (Devralındığı yer: ServiceDescriptionBaseCollection) |
| ToString() |
Geçerli nesneyi temsil eden bir dize döndürür. (Devralındığı yer: Object) |
Belirtik Arabirim Kullanımları
| Name | Description |
|---|---|
| ICollection.CopyTo(Array, Int32) |
Hedef dizinin belirtilen dizininden başlayarak tamamını CollectionBase uyumlu bir tek boyutluya Arraykopyalar. (Devralındığı yer: CollectionBase) |
| ICollection.IsSynchronized |
'a CollectionBase erişimin eşitlenip eşitlenmediğini belirten bir değer alır (iş parçacığı güvenli). (Devralındığı yer: CollectionBase) |
| ICollection.SyncRoot |
CollectionBaseerişimini eşitlemek için kullanılabilecek bir nesnesi alır. (Devralındığı yer: CollectionBase) |
| IList.Add(Object) |
sonuna bir nesne CollectionBaseekler. (Devralındığı yer: CollectionBase) |
| IList.Contains(Object) |
öğesinin CollectionBase belirli bir öğe içerip içermediğini belirler. (Devralındığı yer: CollectionBase) |
| IList.IndexOf(Object) |
Belirtilen Object öğesini arar ve içindeki CollectionBaseilk oluşumun sıfır tabanlı dizinini döndürür. (Devralındığı yer: CollectionBase) |
| IList.Insert(Int32, Object) |
Belirtilen dizinde öğesine CollectionBase bir öğe ekler. (Devralındığı yer: CollectionBase) |
| IList.IsFixedSize |
değerinin sabit bir boyuta sahip olup olmadığını CollectionBase belirten bir değer alır. (Devralındığı yer: CollectionBase) |
| IList.IsReadOnly |
öğesinin salt okunur olup olmadığını CollectionBase belirten bir değer alır. (Devralındığı yer: CollectionBase) |
| IList.Item[Int32] |
Belirtilen dizinde öğesini alır veya ayarlar. (Devralındığı yer: CollectionBase) |
| IList.Remove(Object) |
Belirli bir nesnenin ilk oluşumunu öğesinden CollectionBasekaldırır. (Devralındığı yer: CollectionBase) |
Uzantı Metotları
| Name | Description |
|---|---|
| AsParallel(IEnumerable) |
Sorgunun paralelleştirilmesini etkinleştirir. |
| AsQueryable(IEnumerable) |
bir IEnumerable öğesine IQueryabledönüştürür. |
| Cast<TResult>(IEnumerable) |
öğesinin IEnumerable öğelerini belirtilen türe yazar. |
| OfType<TResult>(IEnumerable) |
Belirtilen türe göre bir IEnumerable öğesinin öğelerini filtreler. |