Message.FindPartsByName(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 an array of type MessagePart that contains the named instances.
public:
cli::array <System::Web::Services::Description::MessagePart ^> ^ FindPartsByName(cli::array <System::String ^> ^ partNames);
public System.Web.Services.Description.MessagePart[] FindPartsByName (string[] partNames);
member this.FindPartsByName : string[] -> System.Web.Services.Description.MessagePart[]
Public Function FindPartsByName (partNames As String()) As MessagePart()
Parameters
- partNames
- String[]
An array of names of the MessagePart instances to be returned.
Returns
An array of type MessagePart.
Exceptions
No MessagePart instances with the specified names exist within the collection.
Examples
The following example demonstrates the use of the FindPartsByName
method.
// Get message from ServiceDescription.
Message^ myMessage1 = myServiceDescription->Messages[ "AddHttpPostIn" ];
Console::WriteLine( "ServiceDescription : {0}", myMessage1->ServiceDescription );
array<String^>^myParts = gcnew array<String^>(2);
myParts[ 0 ] = "a";
myParts[ 1 ] = "b";
array<MessagePart^>^myMessageParts = myMessage1->FindPartsByName( myParts );
Console::WriteLine( "Results of FindPartsByName operation:" );
for ( int i = 0; i < myMessageParts->Length; ++i )
{
Console::WriteLine( "Part Name: {0}", myMessageParts[ i ]->Name );
Console::WriteLine( "Part Type: {0}", myMessageParts[ i ]->Type );
}
// Get message from ServiceDescription.
Message myMessage1 = myServiceDescription.Messages["AddHttpPostIn"];
Console.WriteLine("ServiceDescription :"+myMessage1.ServiceDescription);
string[] myParts = new string[2];
myParts[0] = "a";
myParts[1] = "b";
MessagePart[] myMessageParts = myMessage1.FindPartsByName(myParts);
Console.WriteLine("Results of FindPartsByName operation:");
for(int i=0;i<myMessageParts.Length; ++i)
{
Console.WriteLine("Part Name: " +myMessageParts[i].Name);
Console.WriteLine("Part Type: " +myMessageParts[i].Type);
}
' Get message from ServiceDescription.
Dim myMessage1 As Message = myServiceDescription.Messages("AddHttpPostIn")
Console.WriteLine("ServiceDescription :" + _
myMessage1.ServiceDescription.ToString())
Dim myParts(1) As String
myParts(0) = "a"
myParts(1) = "b"
Dim myMessageParts As MessagePart() = myMessage1.FindPartsByName(myParts)
Console.WriteLine("Results of FindPartsByName operation:")
Dim i As Integer
For i = 0 To myMessageParts.Length - 1
Console.WriteLine("Part Name: " + myMessageParts(i).Name)
Console.WriteLine("Part Type: " + myMessageParts(i).Type.ToString())
Next i
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET