OperationMessage Klasa
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
Reprezentuje typ komunikatu przekazywany przez akcję usługi sieci Web XML.
public ref class OperationMessage abstract : System::Web::Services::Description::DocumentableItem
public ref class OperationMessage abstract : System::Web::Services::Description::NamedItem
public abstract class OperationMessage : System.Web.Services.Description.DocumentableItem
public abstract class OperationMessage : System.Web.Services.Description.NamedItem
type OperationMessage = class
inherit DocumentableItem
type OperationMessage = class
inherit NamedItem
Public MustInherit Class OperationMessage
Inherits DocumentableItem
Public MustInherit Class OperationMessage
Inherits NamedItem
- Dziedziczenie
- Dziedziczenie
- Pochodny
Przykłady
#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;
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;
OperationMessage^ myInputOperationMessage = (OperationMessage^)(gcnew OperationInput);
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "AddSoapIn",myDescription->TargetNamespace );
myInputOperationMessage->Message = myXmlQualifiedName;
myOperationMessageCollection->Insert( 0, myInputOperationMessage );
// Display the operation name of the InputMessage.
Console::WriteLine( "The operation name is {0}", myInputOperationMessage->Operation->Name );
// Add the OperationMessage to the collection.
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 MyOperationMessageSample
{
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;
OperationMessage myInputOperationMessage =
(OperationMessage) new OperationInput();
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
"AddSoapIn", myDescription.TargetNamespace);
myInputOperationMessage.Message = myXmlQualifiedName;
myOperationMessageCollection.Insert(0, myInputOperationMessage);
// Display the operation name of the InputMessage.
Console.WriteLine("The operation name is " +
myInputOperationMessage.Operation.Name);
// Add the OperationMessage to the collection.
myDescription.Write("MathService_new_cs.wsdl");
}
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
}
}
Imports System.Xml
Imports System.Web.Services
Imports System.Web.Services.Description
Class MyOperationMessageSample
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
Dim myInputOperationMessage As OperationMessage = _
CType(New OperationInput(), OperationMessage)
Dim myXmlQualifiedName As New XmlQualifiedName("AddSoapIn", _
myDescription.TargetNamespace)
myInputOperationMessage.Message = myXmlQualifiedName
myOperationMessageCollection.Insert(0, myInputOperationMessage)
' Display the operation name of the InputMessage.
Console.WriteLine("The operation name is " & _
myInputOperationMessage.Operation.Name)
' Add the OperationMessage to the collection.
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
End Class
Uwagi
Ta klasa służy jako klasa bazowa dla następujących klas:
Konstruktorów
| Nazwa | Opis |
|---|---|
| OperationMessage() |
Inicjuje nowe wystąpienie klasy OperationMessage. |
Właściwości
| Nazwa | Opis |
|---|---|
| Documentation |
Pobiera lub ustawia dokumentację tekstu dla wystąpienia klasy DocumentableItem. (Dziedziczone od DocumentableItem) |
| DocumentationElement |
Pobiera lub ustawia element dokumentacji dla elementu DocumentableItem. (Dziedziczone od DocumentableItem) |
| ExtensibleAttributes |
Pobiera lub ustawia tablicę typu XmlAttribute , która reprezentuje rozszerzenia atrybutów WSDL w celu zachowania zgodności z współdziałaniem usług sieci Web (WS-I) Profilu podstawowego 1.1. (Dziedziczone od DocumentableItem) |
| Extensions |
ServiceDescriptionFormatExtensionCollection Pobiera skojarzony z tym DocumentableItemelementem . (Dziedziczone od DocumentableItem) |
| Message |
Pobiera lub ustawia abstrakcyjną, typową definicję przekazywanych danych. |
| Name |
Pobiera lub ustawia nazwę elementu OperationMessage. |
| Name |
Pobiera lub ustawia nazwę elementu. (Dziedziczone od NamedItem) |
| Namespaces |
Pobiera lub ustawia słownik prefiksów przestrzeni nazw i przestrzeni nazw używanych do zachowywania prefiksów przestrzeni nazw i przestrzeni nazw podczas ServiceDescription konstruowania obiektu. (Dziedziczone od DocumentableItem) |
| Operation |
Operation Pobiera element OperationMessage członkowski. |
Metody
| Nazwa | Opis |
|---|---|
| Equals(Object) |
Określa, czy dany obiekt jest taki sam, jak bieżący obiekt. (Dziedziczone od Object) |
| GetHashCode() |
Służy jako domyślna funkcja skrótu. (Dziedziczone od Object) |
| GetType() |
Type Pobiera bieżące wystąpienie. (Dziedziczone od Object) |
| MemberwiseClone() |
Tworzy płytkią kopię bieżącego Objectelementu . (Dziedziczone od Object) |
| ToString() |
Zwraca ciąg reprezentujący bieżący obiekt. (Dziedziczone od Object) |