Message.FindPartByName(String) Metodo
Definizione
Effettua una ricerca nell'oggetto MessagePartCollection restituito dalla proprietà Parts e restituisce l'oggetto MessagePart denominato.Searches the MessagePartCollection returned by the Parts property, and returns the named MessagePart.
public:
System::Web::Services::Description::MessagePart ^ FindPartByName(System::String ^ partName);
public System.Web.Services.Description.MessagePart FindPartByName (string partName);
member this.FindPartByName : string -> System.Web.Services.Description.MessagePart
Public Function FindPartByName (partName As String) As MessagePart
Parametri
- partName
- String
Stringa che denomina l'oggetto MessagePart da restituire.A string that names the MessagePart to be returned.
Restituisce
Oggetto MessagePart.A MessagePart.
Eccezioni
All'interno dell'insieme non esiste alcun oggetto MessagePart con il nome specificato.No MessagePart with the specified name exists within the collection.
Esempio
Nell'esempio seguente viene illustrato l'uso del metodo FindPartByName
.The following example demonstrates the use of the FindPartByName
method.
// Get another message from ServiceDescription.
Message^ myMessage2 = myServiceDescription->Messages[ "DivideHttpGetOut" ];
MessagePart^ myMessagePart = myMessage2->FindPartByName( "Body" );
Console::WriteLine( "Results of FindPartByName operation:" );
Console::WriteLine( "Part Name: {0}", myMessagePart->Name );
Console::WriteLine( "Part Element: {0}", myMessagePart->Element );
// Get another message from ServiceDescription.
Message myMessage2 = myServiceDescription.Messages["DivideHttpGetOut"];
MessagePart myMessagePart=myMessage2.FindPartByName("Body");
Console.WriteLine("Results of FindPartByName operation:");
Console.WriteLine("Part Name: " +myMessagePart.Name);
Console.WriteLine("Part Element: " +myMessagePart.Element);
' Get another message from ServiceDescription.
Dim myMessage2 As Message = myServiceDescription.Messages("DivideHttpGetOut")
Dim myMessagePart As MessagePart = myMessage2.FindPartByName("Body")
Console.WriteLine("Results of FindPartByName operation:")
Console.WriteLine("Part Name: " + myMessagePart.Name)
Console.WriteLine("Part Element: " + myMessagePart.Element.ToString())