Message.FindPartByName(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Parameters
- partName
- String
A string that names the MessagePart to be returned.
Returns
A MessagePart.
Exceptions
No MessagePart with the specified name exists within the collection.
Examples
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())
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET