OperationMessage Класс

Определение

Предоставляет тип сообщения, передаваемый действием веб-службы 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
Наследование
OperationMessage
Наследование
OperationMessage
Производный

Примеры

#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

Комментарии

Этот класс служит базовым классом для следующих классов:

Конструкторы

OperationMessage()

Инициализирует новый экземпляр класса OperationMessage.

Свойства

Documentation

Возвращает или устанавливает текст документации для экземпляра DocumentableItem.

(Унаследовано от DocumentableItem)
DocumentationElement

Получает или задает элемент документации для объекта DocumentableItem.

(Унаследовано от DocumentableItem)
ExtensibleAttributes

Получает или задает массив типа XmlAttribute, представляющий расширения атрибутов WSDL для обеспечения соответствия базовому профилю WS-I версии 1.1.

(Унаследовано от DocumentableItem)
Extensions

Возвращает объект ServiceDescriptionFormatExtensionCollection, связанный с этим объектом DocumentableItem.

(Унаследовано от DocumentableItem)
Message

Возвращает или устанавливает абстрактное типизированное определение передаваемых данных.

Name

Возвращает или задает имя таблицы для объекта OperationMessage.

Name

Возвращает или задает имя элемента.

(Унаследовано от NamedItem)
Namespaces

Получает или задает словарь префиксов пространств имен и пространства имен, используемые для сохранения префиксов пространств имен при конструировании объекта ServiceDescription.

(Унаследовано от DocumentableItem)
Operation

Возвращает объект Operation, членом которого является OperationMessage.

Методы

Equals(Object)

Определяет, равен ли указанный объект текущему объекту.

(Унаследовано от Object)
GetHashCode()

Служит хэш-функцией по умолчанию.

(Унаследовано от Object)
GetType()

Возвращает объект Type для текущего экземпляра.

(Унаследовано от Object)
MemberwiseClone()

Создает неполную копию текущего объекта Object.

(Унаследовано от Object)
ToString()

Возвращает строку, представляющую текущий объект.

(Унаследовано от Object)

Применяется к