WsdlExporter 클래스

정의

서비스, 계약 및 엔드포인트 정보를 메타데이터 문서로 변환합니다.

public ref class WsdlExporter : System::ServiceModel::Description::MetadataExporter
public class WsdlExporter : System.ServiceModel.Description.MetadataExporter
type WsdlExporter = class
    inherit MetadataExporter
Public Class WsdlExporter
Inherits MetadataExporter
상속
WsdlExporter

예제

다음 코드 예제에서는 ExportEndpoint 메서드를 사용하여 MetadataSection라는 ServiceEndpoint 개체 컬렉션의 엔드포인트에서 myServiceEndpoints 개체를 생성하는 방법을 보여 줍니다.

using System;
using System.ServiceModel;
using System.ServiceModel.Description;

namespace WsdlExporterSample
{
    class Program
    {
        static void Main(string[] args)
        {
            WsdlExporter exporter = new WsdlExporter();
            exporter.PolicyVersion = PolicyVersion.Policy15;

            ServiceEndpoint [] myServiceEndpoints = new ServiceEndpoint[2];
            ContractDescription myDescription = new ContractDescription ("myContract");
            myServiceEndpoints[0] = new ServiceEndpoint(myDescription,new BasicHttpBinding(),new EndpointAddress("http://localhost/myservice"));
            myServiceEndpoints[1] = new ServiceEndpoint(myDescription,new BasicHttpBinding(),new EndpointAddress("http://localhost/myservice"));

            // Export all endpoints for each endpoint in collection.
            foreach (ServiceEndpoint endpoint in myServiceEndpoints)
            {
                exporter.ExportEndpoint(endpoint);
            }
            // If there are no errors, get the documents.
            MetadataSet metadataDocs = null;
            if (exporter.Errors.Count != 0)
            {
                metadataDocs = exporter.GetGeneratedMetadata();
            }
        }
    }
}
Imports System.ServiceModel
Imports System.ServiceModel.Description

Module Module1

    Sub Main()
        Dim exporter As New WsdlExporter()
        exporter.PolicyVersion = PolicyVersion.Policy15

        Dim myServiceEndpoints() As ServiceEndpoint = New ServiceEndpoint(1) {}
        Dim myDescription As New ContractDescription("myContract")
        myServiceEndpoints(0) = New ServiceEndpoint(myDescription, New BasicHttpBinding(), New EndpointAddress("http://localhost/myservice"))
        myServiceEndpoints(1) = New ServiceEndpoint(myDescription, New BasicHttpBinding(), New EndpointAddress("http://localhost/myservice"))

        'Export all endpoints for each endpoint in collection.
        For Each endpoint As ServiceEndpoint In myServiceEndpoints
            exporter.ExportEndpoint(endpoint)
        Next

        'If there are no errors, get the documents.
        Dim metadataDocs As MetadataSet
        metadataDocs = Nothing

        If (exporter.Errors.Count = 0) Then
            metadataDocs = exporter.GetGeneratedMetadata()
        End If
    End Sub

End Module

설명

WsdlExporter 또는 ContractDescription 개체를 ServiceEndpoint 개체가 나타내는 메타데이터로 변환하려면 MetadataSection 클래스를 사용합니다.

WsdlExporter는 3단계 프로세스로 사용됩니다.

  1. ExportContract, ExportEndpoint 또는 ExportEndpoints 메서드를 호출하여 적절한 매개 변수를 전달합니다.

  2. 기본 Errors 속성을 검사하여 내보내기 오류가 있는지 여부를 확인합니다.

  3. 오류가 없으면 GetGeneratedMetadata를 사용하여 MetadataSection 개체 컬렉션을 가져오거나, GeneratedWsdlDocuments 또는 GeneratedXmlSchemas 속성을 사용하여 특정 메타데이터 버전을 가져옵니다.

IWsdlExportExtension 인터페이스를 구현하여 사용자 지정 WSDL 확장 내보내기를 지원하고, IPolicyExportExtension 인터페이스를 구현하여 사용자 지정 정책 어설션 내보내기를 지원할 수 있습니다. 자세한 내용은 해당 인터페이스에 대한 설명서를 참조하십시오.

참고

WsdlExporter는 CLR(공용 언어 런타임) 형식 정보를 포함하는 ContractDescription 인스턴스(예: ContractDescription 메서드를 사용하여 작성된 인스턴스 또는 ContractDescription.GetContract 인스턴스에 대한 ServiceDescription의 일부로 작성된 ServiceHost 인스턴스)에서 메타데이터를 내보내는 경우에만 사용할 수 있습니다. 서비스 메타데이터에서 가져왔거나 형식 정보 없이 생성된 WsdlExporter 인스턴스에서 메타데이터를 내보낼 경우에는 ContractDescription를 사용할 수 없습니다.

생성자

WsdlExporter()

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

속성

Errors

메타데이터를 내보내는 중에 발생한 오류의 컬렉션을 가져옵니다.

(다음에서 상속됨 MetadataExporter)
GeneratedWsdlDocuments

내보내기 메서드 중 하나를 호출한 후 ServiceDescription 개체 컬렉션을 가져옵니다.

GeneratedXmlSchemas

내보내기 메서드 중 하나를 호출한 후 XmlSchema 개체 집합을 가져옵니다.

PolicyVersion

사용되는 WS-Policy 사양의 버전을 지정합니다.

(다음에서 상속됨 MetadataExporter)
State

메타데이터 내보내기에 사용되는 개체 사전을 가져옵니다.

(다음에서 상속됨 MetadataExporter)

메서드

Equals(Object)

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

(다음에서 상속됨 Object)
ExportContract(ContractDescription)

지정된 계약 설명에서 계약 정보만 설명하는 메타데이터를 내보냅니다.

ExportEndpoint(ServiceEndpoint)

지정된 엔드포인트에 대한 메타데이터를 생성합니다.

ExportEndpoints(IEnumerable<ServiceEndpoint>, XmlQualifiedName)

지정된 서비스에서 엔드포인트 그룹에 대한 메타데이터를 생성합니다.

ExportPolicy(ServiceEndpoint)

정책 어설션을 PolicyConversionContext 개체로 변환합니다.

(다음에서 상속됨 MetadataExporter)
GetGeneratedMetadata()

생성된 MetadataSection 개체의 열거 가능한 컬렉션을 반환합니다.

GetHashCode()

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상