本文整理匯總了C#中System.ServiceModel.Description.MessagePartDescription類的典型用法代碼示例。如果您正苦於以下問題:C# MessagePartDescription類的具體用法?C# MessagePartDescription怎麽用?C# MessagePartDescription使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MessagePartDescription類屬於System.ServiceModel.Description命名空間,在下文中一共展示了MessagePartDescription類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: PrintDescription
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);
}
}
}
}
}
}