This documentation is archived and is not being maintained.
OperationMessage Class
Visual Studio 2008
Represents a message type passed by the action of an XML Web service.
Assembly: System.Web.Services (in System.Web.Services.dll)
#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 <mscorlib.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(S"MathService_input_cs.wsdl");
PortTypeCollection* myPortTypeCollection =
myDescription->PortTypes;
// Get the OperationCollection for the SOAP protocol.
OperationCollection* myOperationCollection =
myPortTypeCollection->Item[0]->Operations;
// Get the OperationMessageCollection for the Add operation.
OperationMessageCollection* myOperationMessageCollection =
myOperationCollection->Item[0]->Messages;
OperationMessage* myInputOperationMessage =
dynamic_cast<OperationMessage*> (new OperationInput());
XmlQualifiedName* myXmlQualifiedName = new XmlQualifiedName(
S"AddSoapIn", myDescription->TargetNamespace);
myInputOperationMessage->Message = myXmlQualifiedName;
myOperationMessageCollection->Insert(0, myInputOperationMessage);
// Display the operation name of the InputMessage.
Console::WriteLine(S"The operation name is {0}", myInputOperationMessage->Operation->Name);
// Add the OperationMessage to the collection.
myDescription->Write(S"MathService_new_cs.wsdl");
}
catch(Exception* e)
{
Console::WriteLine(S"Exception caught!!!");
Console::WriteLine(S"Source : {0}", e->Source);
Console::WriteLine(S"Message : {0}", e->Message);
}
}
System::Object
System.Web.Services.Description::DocumentableItem
System.Web.Services.Description::NamedItem
System.Web.Services.Description::OperationMessage
System.Web.Services.Description::OperationFault
System.Web.Services.Description::OperationInput
System.Web.Services.Description::OperationOutput
System.Web.Services.Description::DocumentableItem
System.Web.Services.Description::NamedItem
System.Web.Services.Description::OperationMessage
System.Web.Services.Description::OperationFault
System.Web.Services.Description::OperationInput
System.Web.Services.Description::OperationOutput
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: