OperationMessage Class
.NET Framework 2.0
Represents a message type passed by the action of an XML Web service.
Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)
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 ); } }
import System.*;
import System.Xml.*;
import System.Web.Services.*;
import System.Web.Services.Description.*;
class MyOperationMessageSample
{
public static void main(String[] args)
{
try {
ServiceDescription myDescription = ServiceDescription.
Read("MathService_input_jsl.wsdl");
PortTypeCollection myPortTypeCollection = myDescription.
get_PortTypes();
// Get the OperationCollection for the SOAP protocol.
OperationCollection myOperationCollection = myPortTypeCollection.
get_Item(0).get_Operations();
// Get the OperationMessageCollection for the Add operation.
OperationMessageCollection myOperationMessageCollection =
myOperationCollection.get_Item(0).get_Messages();
OperationMessage myInputOperationMessage = (OperationMessage)
new OperationInput();
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName(
"AddSoapIn", myDescription.get_TargetNamespace());
myInputOperationMessage.set_Message(myXmlQualifiedName);
myOperationMessageCollection.Insert(0, myInputOperationMessage);
// Display the operation name of the InputMessage.
Console.WriteLine("The operation name is "
+ myInputOperationMessage.get_Operation().get_Name());
// Add the OperationMessage to the collection.
myDescription.Write("MathService_new_jsl.wsdl");
}
catch (System.Exception e) {
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.get_Source());
Console.WriteLine("Message : " + e.get_Message());
}
} //main
} //MyOperationMessageSample
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.Community Additions
ADD
Show: