Message.FindPartsByName(String[]) Method

Definition

Searches the MessagePartCollection returned by the Parts property and returns an array of type MessagePart that contains the named instances.

public System.Web.Services.Description.MessagePart[] FindPartsByName(string[] partNames);

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 :"+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);
}

Applies to

Produkt Verze
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)