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:
property MessagePart^ default[
	String^ name
] {
	MessagePart^ get(String^ name);
}

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      : {0}", myLocalMessage->Name );

   // Get the message part collection.
   MessagePartCollection^ myMessagePartCollection = myLocalMessage->Parts;
   array<MessagePart^>^myMessagePart = gcnew array<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 : {0}", myMessagePartCollection[ k ]->Name );
   Console::WriteLine( "" );
}

.NET Framework
Available since 1.1
Return to top
Show: