ServiceDescription.Messages Property

Gets the collection of Message elements contained in the ServiceDescription.

Namespace: System.Web.Services.Description
Assembly: System.Web.Services (in system.web.services.dll)

public:
property MessageCollection^ Messages {
	MessageCollection^ get ();
}
/** @property */
public MessageCollection get_Messages ()

public function get Messages () : MessageCollection

Not applicable.

Property Value

A MessageCollection.

The MessageCollection returned by this property corresponds to the list of message elements enclosed by the Web Services Description Language (WSDL) definitions root element. For more information about WSDL, see the specification at http://www.w3.org/TR/wsdl/.

ServiceDescription^ myDescription = gcnew ServiceDescription;
myDescription = ServiceDescription::Read( "MyWsdl_CS.wsdl" );
myDescription->Name = "MyServiceDescription";
Console::WriteLine( "Name: {0}", myDescription->Name );
MessageCollection^ myMessageCollection = myDescription->Messages;

// Remove the message at index 0 from the message collection.
myMessageCollection->Remove( myDescription->Messages[ 0 ] );

// Build a new message.
Message^ myMessage = gcnew Message;
myMessage->Name = "AddSoapIn";

// Build a new MessagePart.
MessagePart^ myMessagePart = gcnew MessagePart;
myMessagePart->Name = "parameters";
XmlQualifiedName^ myXmlQualifiedName = gcnew XmlQualifiedName( "s0:Add" );
myMessagePart->Element = myXmlQualifiedName;

// Add MessageParts to the message.
myMessage->Parts->Add( myMessagePart );

// Add the message to the ServiceDescription.
myDescription->Messages->Add( myMessage );
myDescription->Write( "MyOutWsdl.wsdl" );

ServiceDescription myDescription = new ServiceDescription();
myDescription = ServiceDescription.Read("MyWsdl_JSL.wsdl");
myDescription.set_Name("MyServiceDescription");
Console.WriteLine("Name: " + myDescription.get_Name());
MessageCollection myMessageCollection = myDescription.get_Messages();
// Remove the message at index 0 from the message collection.
myMessageCollection.Remove(myDescription.get_Messages().get_Item(0));
// Build a new message.
Message myMessage = new Message();
myMessage.set_Name("AddSoapIn");
// Build a new MessagePart.
MessagePart myMessagePart = new MessagePart();
myMessagePart.set_Name("parameters");
XmlQualifiedName myXmlQualifiedName = new XmlQualifiedName("s0:Add");
myMessagePart.set_Element(myXmlQualifiedName);
// Add MessageParts to the message.
myMessage.get_Parts().Add(myMessagePart);
// Add the message to the ServiceDescription.
myDescription.get_Messages().Add(myMessage);
myDescription.Write("MyOutWsdl.wsdl");

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.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: