The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
MessagePartDescription Class
.NET Framework 3.0
Represents a description of a SOAP message part.
Namespace: System.ServiceModel.Description
Assembly: System.ServiceModel (in system.servicemodel.dll)
Assembly: System.ServiceModel (in system.servicemodel.dll)
The MessagePartDescription class is the parent class of MessageHeaderDescription and MessagePropertyDescription and contains the basic functionality of both classes.
The following example uses the MessagePartDescription returned by the Parts property of the MessageBodyDescription class. The code iterates through the collection of endpoints and prints each endpoint name, as well as the name of each operation in the endpoint.
private void PrintDescription(ServiceHost sh) { // Declare variables. int i, j, k, l, c; ServiceDescription servDesc = sh.Description; OperationDescription opDesc; ContractDescription contractDesc; MessageDescription methDesc; MessageBodyDescription mBodyDesc; MessagePartDescription partDesc; IServiceBehavior servBeh; ServiceEndpoint servEP; // Print the behaviors of the service. Console.WriteLine("Behaviors:"); for (c = 0; c < servDesc.Behaviors.Count; c++) { servBeh = servDesc.Behaviors[c]; Console.WriteLine("\t{0}", servBeh.ToString()); } // Print the endpoint descriptions of the service. Console.WriteLine("Endpoints"); for (i = 0; i < servDesc.Endpoints.Count; i++) { // Print the endpoint names. servEP = servDesc.Endpoints[i]; Console.WriteLine("\tName: {0}", servEP.Name); contractDesc = servEP.Contract; Console.WriteLine("\tOperations:"); for (j = 0; j < contractDesc.Operations.Count; j++) { // Print the operation names. opDesc = servEP.Contract.Operations[j]; Console.WriteLine("\t\t{0}", opDesc.Name); Console.WriteLine("\t\tActions:"); for (k = 0; k < opDesc.Messages.Count; k++) { // Print the message action. methDesc = opDesc.Messages[k]; Console.WriteLine("\t\t\tAction:{0}", methDesc.Action); // Check for the existence of a body, then the body description. mBodyDesc = methDesc.Body; if (mBodyDesc.Parts.Count > 0) { for (l = 0; l < methDesc.Body.Parts.Count; l++) { partDesc = methDesc.Body.Parts[l]; Console.WriteLine("\t\t\t\t{0}",partDesc.Name); } } } } } }
System.Object
System.ServiceModel.Description.MessagePartDescription
System.ServiceModel.Description.MessageHeaderDescription
System.ServiceModel.Description.MessagePropertyDescription
System.ServiceModel.Description.MessagePartDescription
System.ServiceModel.Description.MessageHeaderDescription
System.ServiceModel.Description.MessagePropertyDescription
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.