This documentation is archived and is not being maintained.

MessageCollection Class

Represents a collection of instances of the Message class. This class cannot be inherited.

For a list of all members of this type, see MessageCollection Members.

System.Object
   System.Collections.CollectionBase
      System.Web.Services.Description.ServiceDescriptionBaseCollection
         System.Web.Services.Description.MessageCollection

[Visual Basic]
NotInheritable Public Class MessageCollection
   Inherits ServiceDescriptionBaseCollection
[C#]
public sealed class MessageCollection :
   ServiceDescriptionBaseCollection
[C++]
public __gc __sealed class MessageCollection : public
   ServiceDescriptionBaseCollection
[JScript]
public class MessageCollection extends
   ServiceDescriptionBaseCollection

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Example

[Visual Basic] 
Dim myServiceDescription As ServiceDescription = _
   ServiceDescription.Read ("MathService_input_vb.wsdl")

' Create SOAP messages.
Dim myMessage As New Message()
myMessage.Name = "AddSoapOut"
Dim myMessagePart As New MessagePart()
myMessagePart.Name = "parameters"
myMessagePart.Element = New XmlQualifiedName("AddResponse", _
   myServiceDescription.TargetNamespace)
myMessage.Parts.Add(myMessagePart)
myServiceDescription.Messages.Add(myMessage)

[C#] 
ServiceDescription myServiceDescription = 
   ServiceDescription.Read("MathService_input_cs.wsdl");

// Create SOAP messages.
Message myMessage = new Message();
myMessage.Name = "AddSoapOut";
MessagePart myMessagePart = new MessagePart();
myMessagePart.Name = "parameters";
myMessagePart.Element = new 
   XmlQualifiedName("AddResponse",myServiceDescription.TargetNamespace);
myMessage.Parts.Add(myMessagePart);
myServiceDescription.Messages.Add(myMessage);

[C++] 
ServiceDescription* myServiceDescription =
   ServiceDescription::Read(S"MathService_input_cs.wsdl");

// Create SOAP messages.
Message* myMessage = new Message();
myMessage->Name = S"AddSoapOut";
MessagePart* myMessagePart = new MessagePart();
myMessagePart->Name = S"parameters";
myMessagePart->Element = new
   XmlQualifiedName(S"AddResponse",myServiceDescription->TargetNamespace);
myMessage->Parts->Add(myMessagePart);
myServiceDescription->Messages->Add(myMessage);

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Web.Services.Description

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Web.Services (in System.Web.Services.dll)

See Also

MessageCollection Members | System.Web.Services.Description Namespace

Show: