Message.Parts Property

 

Gets the collection of the MessagePart objects contained in the Message.

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

public MessagePartCollection Parts { get; }

The following example demonstrates a typical use of the Parts property.

// Creates a Message with name = messageName having one MessagePart 
// with name = partName.
public static Message CreateMessage(string messageName,string partName,
   string element,string targetNamespace)
{
   Message myMessage = new Message();
   myMessage.Name = messageName;
   MessagePart myMessagePart = new MessagePart();
   myMessagePart.Name = partName;
   myMessagePart.Element = new XmlQualifiedName(element,targetNamespace);
   myMessage.Parts.Add(myMessagePart);
   return myMessage;
}

.NET Framework
Available since 1.1
Return to top
Show: