MessagePartCollection.Item Property (String)

 

Gets a MessagePart specified by its name.

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

public MessagePart this[
	string name
] { get; }

Parameters

name
Type: System.String

The name of the MessagePart returned.

Property Value

Type: System.Web.Services.Description.MessagePart

A MessagePart.

Message myLocalMessage = myServiceDescription.Messages["AddHttpPostOut"];
if (myMessageCollection.Contains(myLocalMessage))
{
   Console.WriteLine("Message      : " + myLocalMessage.Name);

   // Get the message part collection.
   MessagePartCollection myMessagePartCollection = myLocalMessage.Parts;
   MessagePart[] myMessagePart  = 
      new MessagePart[myMessagePartCollection.Count];

   // Copy the MessagePartCollection to an array.
   myMessagePartCollection.CopyTo(myMessagePart,0);
   for(int k = 0; k < myMessagePart.Length; k++)
   {
      Console.WriteLine("\t       Part Name : " + 
         myMessagePartCollection[k].Name);
   }
   Console.WriteLine("");
}

.NET Framework
Available since 1.1
Return to top
Show: