MessagePartDescription 클래스

정의

SOAP 메시지 부분에 대한 설명을 나타냅니다.

public ref class MessagePartDescription
public class MessagePartDescription
type MessagePartDescription = class
Public Class MessagePartDescription
상속
MessagePartDescription
파생

예제

다음 예제에서는 클래스의 MessagePartDescription 속성에서 반환된 Parts 합니다 MessageBodyDescription . 이 코드는 엔드포인트 컬렉션을 반복하고 엔드포인트의 각 작업 이름과 각 엔드포인트 이름을 출력합니다.

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);
                    }
                }
            }
        }
    }
}
Private Sub PrintDescription(ByVal sh As ServiceHost) 
    ' Declare variables.
    Dim i, j, k, l, c As Integer
    Dim servDesc As ServiceDescription = sh.Description
    Dim opDesc As OperationDescription
    Dim contractDesc As ContractDescription
    Dim methDesc As MessageDescription
    Dim mBodyDesc As MessageBodyDescription
    Dim partDesc As MessagePartDescription
    Dim servBeh As IServiceBehavior
    Dim servEP As ServiceEndpoint
    
    ' Print the behaviors of the service.
    Console.WriteLine("Behaviors:")
    For c = 0 To servDesc.Behaviors.Count-1
        servBeh = servDesc.Behaviors(c)
        Console.WriteLine(vbTab + "{0}", servBeh)
    Next c
    
    ' Print the endpoint descriptions of the service.
    Console.WriteLine("Endpoints")
    For i = 0 To servDesc.Endpoints.Count-1
        ' Print the endpoint names.
        servEP = servDesc.Endpoints(i)
        Console.WriteLine(vbTab + "Name: {0}", servEP.Name)
        contractDesc = servEP.Contract
        
        Console.WriteLine(vbTab + "Operations:")
        For j = 0 To contractDesc.Operations.Count-1
            ' Print operation names.
            opDesc = servEP.Contract.Operations(j)
            Console.WriteLine(vbTab + vbTab + "{0}", opDesc.Name)
            Console.WriteLine(vbTab + vbTab + "Actions:")
            For k = 0 To opDesc.Messages.Count-1
                ' Print the message action. 
                methDesc = opDesc.Messages(k)
                Console.WriteLine(vbTab + vbTab + vbTab + _
                  "Action:{0}", methDesc.Action)
                
                ' Check for the existence of a body, then the body description.
                mBodyDesc = methDesc.Body
                If mBodyDesc.Parts.Count > 0 Then
                    For l = 0 To methDesc.Body.Parts.Count-1
                        partDesc = methDesc.Body.Parts(l)
                        Console.WriteLine(vbTab + vbTab + _
                        vbTab + vbTab + "{0}", partDesc.Name)
                    Next l
                End If
            Next k
        Next j
    Next i

End Sub

설명

클래스는 MessagePartDescription 부모 클래스이며 MessagePropertyDescription 두 클래스 MessageHeaderDescription 의 기본 기능을 포함합니다.

생성자

MessagePartDescription(String, String)

MessagePartDescription 클래스의 새 인스턴스를 초기화합니다.

속성

HasProtectionLevel

메시지 부분에 ProtectionLevel 속성에 대한 값이 있는지 여부를 나타내는 값을 가져옵니다.

Index

메시지 부분의 인덱스를 가져오거나 설정합니다.

MemberInfo

메시지 부분에 대한 멤버 정보를 가져오거나 설정합니다.

Multiple

메시지 부분이 메시지에서 두 번 이상 표시될 수 있는지 여부를 제어하는 값을 가져오거나 설정합니다.

Name

메시지 부분의 이름을 가져오거나 설정합니다.

Namespace

메시지 부분의 네임스페이스를 가져오거나 설정합니다.

ProtectionLevel

메시지 부분의 ProtectionLevel을 가져오거나 설정합니다.

Type

메시지 부분의 형식을 가져오거나 설정합니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상