MetadataResolver.Resolve 메서드

정의

메타데이터 주소를 다운로드한 후 해당 서비스에 대한 ServiceEndpoint 개체로 확인합니다.

오버로드

Resolve(IEnumerable<ContractDescription>, EndpointAddress)

지정된 메타데이터 주소를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

Resolve(Type, EndpointAddress)

메타데이터 주소를 다운로드한 후 지정된 주소의 지정된 계약에 대한 ServiceEndpoint 개체 컬렉션으로 확인합니다.

Resolve(IEnumerable<ContractDescription>, EndpointAddress, MetadataExchangeClient)

지정된 메타데이터 주소 및 ServiceEndpoint를 사용하여 지정된 계약에 대한 MetadataExchangeClient 개체로 메타데이터 주소를 확인합니다.

Resolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode)

지정된 주소 및 전송 모드를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

Resolve(Type, Uri, MetadataExchangeClientMode)

지정된 주소 및 전송 모드를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

Resolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, MetadataExchangeClient)

지정된 주소, 전송 모드 및 전송 클라이언트를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

설명

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

모든 동기 및 비동기 Resolve 메서드는 가져온 엔드포인트가나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션을 반환합니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

Resolve(IEnumerable<ContractDescription>, EndpointAddress)

지정된 메타데이터 주소를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, System::ServiceModel::EndpointAddress ^ address);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, System.ServiceModel.EndpointAddress address);
static member Resolve : seq<System.ServiceModel.Description.ContractDescription> * System.ServiceModel.EndpointAddress -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contracts As IEnumerable(Of ContractDescription), address As EndpointAddress) As ServiceEndpointCollection

매개 변수

contracts
IEnumerable<ContractDescription>

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
EndpointAddress

메타데이터 주소입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소 또는 계약 컬렉션이 null인 경우

contracts가 비어 있거나, 하나 이상의 contracts 멤버가 null이거나, contracts에 이름과 네임스페이스가 동일한 계약이 둘 이상 포함된 경우

설명

System.ServiceModel.Description.MetadataExchangeClient의 기본 설정은 메타데이터를 검색하는 데 사용되며, 기본 System.ServiceModel.Description.MetadataExchangeClientModeMetadataExchangeClientMode.MetadataExchange입니다.

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

적용 대상

Resolve(Type, EndpointAddress)

메타데이터 주소를 다운로드한 후 지정된 주소의 지정된 계약에 대한 ServiceEndpoint 개체 컬렉션으로 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(Type ^ contract, System::ServiceModel::EndpointAddress ^ address);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (Type contract, System.ServiceModel.EndpointAddress address);
static member Resolve : Type * System.ServiceModel.EndpointAddress -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contract As Type, address As EndpointAddress) As ServiceEndpointCollection

매개 변수

contract
Type

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
EndpointAddress

메타데이터 주소입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소 또는 계약이 null인 경우

예제

다음 코드 예제에서는 MetadataResolver 클래스를 사용하여 ServiceEndpoint 개체 컬렉션으로 메타데이터를 반환하는 방법을 보여 줍니다. 이렇게 반환된 개체는 서비스 인스턴스에 연결하는 데 사용됩니다.

// Get the endpoints for such a service
ServiceEndpointCollection endpoints = MetadataResolver.Resolve(typeof(SampleServiceClient), metaAddress);
Console.WriteLine("Trying all available WS-Transfer metadata endpoints...");

foreach (ServiceEndpoint point in endpoints)
{
    if (point != null)
    {
        // Create a new wcfClient using retrieved endpoints.
        wcfClient = new SampleServiceClient(point.Binding, point.Address);
        Console.WriteLine(
          wcfClient.SampleMethod("Client used the "
          + point.Address.ToString()
          + " address.")
        );
        wcfClient.Close();
    }
}

설명

Resolve 메서드를 사용하여 메타데이터를 다운로드하고 분석할 때 사용할 계약 및 메타데이터 주소를 지정합니다.

System.ServiceModel.Description.MetadataExchangeClient의 기본 설정은 메타데이터를 검색하는 데 사용되며, 기본 System.ServiceModel.Description.MetadataExchangeClientModeMetadataExchangeClientMode.MetadataExchange입니다.

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

이 메서드를 사용하려면 계약 형식을 지정해야 합니다. 클라이언트 코드에서 서비스 인터페이스를 선언 하거나 Svcutil.exe에 의해 생성 된 WCF 클라이언트를 사용 하 여 계약을 지정할 수 있습니다. 인터페이스가 변경 되 면 (예를 들어 새 작업을 추가)을 클라이언트 코드에서 인터페이스를 업데이트 하거나 새 WCF 클라이언트 생성. 이렇게 하지 않으면 예외가 throw됩니다. Add(), Sub(), Mult() 및 Div()를 정의하는 ICalculator라는 서비스 계약을 구현하는 서비스를 예로 들어 보겠습니다. 클라이언트 애플리케이션을 만들고 WCF 클라이언트를 생성 합니다. ICalculator에 Echo()라는 메서드를 추가합니다. 다음 호출 하는 애플리케이션 작성 하는 경우 Resolve(Type, EndpointAddress) 새 WCF 클라이언트를 생성 하지 않고 다음 예외를 가져옵니다.

Unhandled Exception: System.ServiceModel.Description.WsdlImporter+WsdlImportException: Cannot locate operation Echo in Contract ICalculator.

적용 대상

Resolve(IEnumerable<ContractDescription>, EndpointAddress, MetadataExchangeClient)

지정된 메타데이터 주소 및 ServiceEndpoint를 사용하여 지정된 계약에 대한 MetadataExchangeClient 개체로 메타데이터 주소를 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, System::ServiceModel::EndpointAddress ^ address, System::ServiceModel::Description::MetadataExchangeClient ^ client);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, System.ServiceModel.EndpointAddress address, System.ServiceModel.Description.MetadataExchangeClient client);
static member Resolve : seq<System.ServiceModel.Description.ContractDescription> * System.ServiceModel.EndpointAddress * System.ServiceModel.Description.MetadataExchangeClient -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contracts As IEnumerable(Of ContractDescription), address As EndpointAddress, client As MetadataExchangeClient) As ServiceEndpointCollection

매개 변수

contracts
IEnumerable<ContractDescription>

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
EndpointAddress

메타데이터 주소입니다.

client
MetadataExchangeClient

메타데이터를 검색하는 데 사용되는 MetadataExchangeClient입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소, 계약 컬렉션 또는 클라이언트가 null인 경우

contracts가 비어 있거나, 하나 이상의 contracts 멤버가 null이거나, contracts에 이름과 네임스페이스가 동일한 계약이 둘 이상 포함된 경우

설명

기본 System.ServiceModel.Description.MetadataExchangeClientModeMetadataExchangeClientMode.MetadataExchange입니다.

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

적용 대상

Resolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode)

지정된 주소 및 전송 모드를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode);
static member Resolve : seq<System.ServiceModel.Description.ContractDescription> * Uri * System.ServiceModel.Description.MetadataExchangeClientMode -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contracts As IEnumerable(Of ContractDescription), address As Uri, mode As MetadataExchangeClientMode) As ServiceEndpointCollection

매개 변수

contracts
IEnumerable<ContractDescription>

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
Uri

메타데이터 주소입니다.

mode
MetadataExchangeClientMode

검색 모드입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소 또는 계약 컬렉션이 null인 경우

contracts가 비어 있거나, 하나 이상의 contracts 멤버가 null이거나, contracts에 이름과 네임스페이스가 동일한 계약이 둘 이상 포함된 경우

설명

System.ServiceModel.Description.MetadataExchangeClient의 기본 설정은 메타데이터를 검색하는 데 사용됩니다.

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

적용 대상

Resolve(Type, Uri, MetadataExchangeClientMode)

지정된 주소 및 전송 모드를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(Type ^ contract, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (Type contract, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode);
static member Resolve : Type * Uri * System.ServiceModel.Description.MetadataExchangeClientMode -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contract As Type, address As Uri, mode As MetadataExchangeClientMode) As ServiceEndpointCollection

매개 변수

contract
Type

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
Uri

메타데이터 주소입니다.

mode
MetadataExchangeClientMode

검색 모드입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소 또는 계약이 null인 경우

예제

다음 코드 예제에서는 WS-Transfer 대신 HTTP GET 요청을 사용하여 MetadataResolver를 통해 메타데이터를 다운로드한 다음 ServiceEndpoint 개체 컬렉션으로 반환하는 방법을 보여 줍니다.

// Get the endpoints for such a service using Http/Get request
endpoints = MetadataResolver.Resolve(typeof(SampleServiceClient), httpGetMetaAddress.Uri, MetadataExchangeClientMode.HttpGet);
Client.WriteParameters(endpoints);
ISampleService serviceChannel;
Console.WriteLine(
  "\r\nTrying all endpoints from HTTP/Get and with direct service channels...");

foreach (ServiceEndpoint point in endpoints)
{
    if (point != null)
    {
        ChannelFactory<ISampleService> factory = new ChannelFactory<ISampleService>(point.Binding);
        factory.Endpoint.Address = point.Address;
        serviceChannel = factory.CreateChannel();
        Console.WriteLine("Client used the " + point.Address.ToString() + " address.");
        Console.WriteLine(
          serviceChannel.SampleMethod(
            "Client used the " + point.Address.ToString() + " address."
          )
        );
        factory.Close();
    }
}

설명

Resolve 메서드를 사용하여 계약, 주소 및 사용할 다운로드 메커니즘을 지정합니다.

System.ServiceModel.Description.MetadataExchangeClient의 기본 설정은 메타데이터를 검색하는 데 사용됩니다.

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

적용 대상

Resolve(IEnumerable<ContractDescription>, Uri, MetadataExchangeClientMode, MetadataExchangeClient)

지정된 주소, 전송 모드 및 전송 클라이언트를 사용하여 지정된 계약에 대한 ServiceEndpoint 개체로 메타데이터 주소를 확인합니다.

public:
 static System::ServiceModel::Description::ServiceEndpointCollection ^ Resolve(System::Collections::Generic::IEnumerable<System::ServiceModel::Description::ContractDescription ^> ^ contracts, Uri ^ address, System::ServiceModel::Description::MetadataExchangeClientMode mode, System::ServiceModel::Description::MetadataExchangeClient ^ client);
public static System.ServiceModel.Description.ServiceEndpointCollection Resolve (System.Collections.Generic.IEnumerable<System.ServiceModel.Description.ContractDescription> contracts, Uri address, System.ServiceModel.Description.MetadataExchangeClientMode mode, System.ServiceModel.Description.MetadataExchangeClient client);
static member Resolve : seq<System.ServiceModel.Description.ContractDescription> * Uri * System.ServiceModel.Description.MetadataExchangeClientMode * System.ServiceModel.Description.MetadataExchangeClient -> System.ServiceModel.Description.ServiceEndpointCollection
Public Shared Function Resolve (contracts As IEnumerable(Of ContractDescription), address As Uri, mode As MetadataExchangeClientMode, client As MetadataExchangeClient) As ServiceEndpointCollection

매개 변수

contracts
IEnumerable<ContractDescription>

메타데이터를 다운로드하여 확인할 대상 계약입니다.

address
Uri

메타데이터 주소입니다.

mode
MetadataExchangeClientMode

검색 모드입니다.

client
MetadataExchangeClient

메타데이터를 검색하는 데 사용되는 MetadataExchangeClient입니다.

반환

ServiceEndpointCollection

지정된 계약의 ServiceEndpoint 개체 컬렉션입니다.

예외

주소, 계약 컬렉션 또는 클라이언트가 null인 경우

contracts가 비어 있거나, 하나 이상의 contracts 멤버가 null이거나, contracts에 이름과 네임스페이스가 동일한 계약이 둘 이상 포함된 경우

설명

@FSHO1@메타데이터를 다운로드하지만 ServiceEndpoint 개체로 정보를 확인하지 않으려면 System.ServiceModel.Description.MetadataExchangeClient를 직접 사용하십시오.

참고

엔드포인트를 하나도 가져오지 않았거나 계약과 일치하는 엔드포인트가 없으면 빈 컬렉션이 반환됩니다. 빈 컬렉션이 반환되면 경고 추적이 기록됩니다.

적용 대상