OperationMessage Klasse
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Stellt einen Nachrichtentyp dar, der von der Aktion eines XML-Webdiensts übergeben wird.
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
- Vererbung
- Vererbung
- Abgeleitet
Beispiele
#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
Hinweise
Diese Klasse dient als Basisklasse für die folgenden Klassen:
Konstruktoren
| Name | Beschreibung |
|---|---|
| OperationMessage() |
Initialisiert eine neue Instanz der OperationMessage-Klasse. |
Eigenschaften
| Name | Beschreibung |
|---|---|
| Documentation |
Ruft die Textdokumentation für die Instanz der DocumentableItem. (Geerbt von DocumentableItem) |
| DocumentationElement |
Ruft ab oder legt das Dokumentationselement für die DocumentableItem. (Geerbt von DocumentableItem) |
| ExtensibleAttributes |
Dient zum Abrufen oder Festlegen eines Arrays vom Typ XmlAttribute , das Attributerweiterungen von WSDL darstellt, um web Services Interoperability (WS-I) Basic Profile 1.1 einzuhalten. (Geerbt von DocumentableItem) |
| Extensions |
Ruft die ServiceDescriptionFormatExtensionCollection diesem DocumentableItemzugeordnete ab. (Geerbt von DocumentableItem) |
| Message |
Dient zum Abrufen oder Festlegen einer abstrakten, typierten Definition der kommunizierten Daten. |
| Name |
Dient zum Abrufen oder Festlegen des Namens der OperationMessage. |
| Name |
Dient zum Abrufen oder Festlegen des Namens des Elements. (Geerbt von NamedItem) |
| Namespaces |
Ruft das Wörterbuch der Namespacepräfixe und Namespaces ab, die zum Beibehalten von Namespacepräfixen und Namespaces verwendet werden, wenn ein ServiceDescription Objekt erstellt wird, oder legt es fest. (Geerbt von DocumentableItem) |
| Operation |
Ruft ab Operation , von denen das OperationMessage Mitglied ist. |
Methoden
| Name | Beschreibung |
|---|---|
| Equals(Object) |
Bestimmt, ob das angegebene Objekt dem aktuellen Objekt entspricht. (Geerbt von Object) |
| GetHashCode() |
Dient als Standardhashfunktion. (Geerbt von Object) |
| GetType() |
Ruft die Type der aktuellen Instanz ab. (Geerbt von Object) |
| MemberwiseClone() |
Erstellt eine flache Kopie der aktuellen Object. (Geerbt von Object) |
| ToString() |
Gibt eine Zeichenfolge zurück, die das aktuelle Objekt darstellt. (Geerbt von Object) |