Message.FindPartsByName Method (String[])


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

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

public MessagePart[] FindPartsByName(
	string[] partNames


Type: System.String[]

An array of names of the MessagePart instances to be returned.

Return Value

Type: System.Web.Services.Description.MessagePart[]

An array of type MessagePart.

Exception Condition

No MessagePart instances with the specified names exist within the collection.

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);

.NET Framework
Available since 1.1
Return to top