ClientBase<TChannel> 클래스

정의

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

generic <typename TChannel>
 where TChannel : classpublic ref class ClientBase abstract : IDisposable, System::ServiceModel::ICommunicationObject
generic <typename TChannel>
 where TChannel : classpublic ref class ClientBase abstract : System::ServiceModel::ICommunicationObject
generic <typename TChannel>
 where TChannel : classpublic ref class ClientBase abstract : IAsyncDisposable, IDisposable, System::ServiceModel::ICommunicationObject
public abstract class ClientBase<TChannel> : IDisposable, System.ServiceModel.ICommunicationObject where TChannel : class
public abstract class ClientBase<TChannel> : System.ServiceModel.ICommunicationObject where TChannel : class
public abstract class ClientBase<TChannel> : IAsyncDisposable, IDisposable, System.ServiceModel.ICommunicationObject where TChannel : class
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface IDisposable
    interface ICommunicationObject
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface ICommunicationObject
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface ICommunicationObject
    interface IDisposable
    interface IAsyncDisposable
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface ICommunicationObject
    interface IDisposable
Public MustInherit Class ClientBase(Of TChannel)
Implements ICommunicationObject, IDisposable
Public MustInherit Class ClientBase(Of TChannel)
Implements ICommunicationObject
Public MustInherit Class ClientBase(Of TChannel)
Implements IAsyncDisposable, ICommunicationObject, IDisposable

형식 매개 변수

TChannel

서비스에 연결할 때 사용할 채널입니다.

상속
ClientBase<TChannel>
파생
구현

예제

다음 코드 예제에서는 ServiceModel 메타데이터 유틸리티 도구(Svcutil.exe) 가 클래스를 ClientBase<TChannel> 확장하여 WCF 클라이언트 클래스를 만드는 방법을 보여 줍니다.

public partial class SampleServiceClient : System.ServiceModel.ClientBase<ISampleService>, ISampleService
{

    public SampleServiceClient()
    {
    }

    public SampleServiceClient(string endpointConfigurationName) :
            base(endpointConfigurationName)
    {
    }

    public SampleServiceClient(string endpointConfigurationName, string remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public SampleServiceClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) :
            base(endpointConfigurationName, remoteAddress)
    {
    }

    public SampleServiceClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) :
            base(binding, remoteAddress)
    {
    }

    public string SampleMethod(string msg)
    {
        return base.Channel.SampleMethod(msg);
    }
}
<System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "3.0.0.0")> _
Partial Public Class SampleServiceClient
    Inherits System.ServiceModel.ClientBase(Of ISampleService)
    Implements ISampleService

    Public Sub New()
    End Sub

    Public Sub New(ByVal endpointConfigurationName As String)
        MyBase.New(endpointConfigurationName)
    End Sub

    Public Sub New(ByVal endpointConfigurationName As String, ByVal remoteAddress As String)
        MyBase.New(endpointConfigurationName, remoteAddress)
    End Sub

    Public Sub New(ByVal endpointConfigurationName As String, _
                   ByVal remoteAddress As System.ServiceModel.EndpointAddress)
        MyBase.New(endpointConfigurationName, remoteAddress)
    End Sub

    Public Sub New(ByVal binding As System.ServiceModel.Channels.Binding, _
                   ByVal remoteAddress As System.ServiceModel.EndpointAddress)
        MyBase.New(binding, remoteAddress)
    End Sub

    Public Function SampleMethod(ByVal msg As String) As String Implements ISampleService.SampleMethod
        Return MyBase.Channel.SampleMethod(msg)
    End Function
End Class

설명

클래스를 ClientBase<TChannel> 확장하여 서비스에 연결하는 데 사용할 수 있는 사용자 지정 WCF 클라이언트 개체를 만듭니다. 일반적으로 WCF 클라이언트 기본 클래스는 사용자를 대신하여 ServiceModel 메타데이터 유틸리티 도구(Svcutil.exe) 와 같은 도구에 의해 확장됩니다. 예제에 대해서는 예제 섹션을 참조하세요.

클래스는 ClientBase<TChannel> 인터페이스 및 클래스를 사용하기 위해 개체를 선호하는 개발자가 빠르고 쉽게 사용할 수 있습니다 System.ServiceModel.ChannelFactory<TChannel> . 모든 경우에 이 클래스는 클래스 및 인터페이스의 System.ServiceModel.ChannelFactory<TChannel> 메서드와 기능을 래핑하거나 노출합니다 System.ServiceModel.IClientChannel .

System.ServiceModel.ServiceHost 클래스를 사용할 때와 마찬가지로, 임의의 호출을 수행하거나 Open을 호출하기 전에 클래스를 만들고 엔드포인트, 채널 팩터리 또는 보안 정보를 수정할 수 있습니다. 자세한 내용은 WCF 클라이언트 개요WCF 클라이언트를 사용하여 서비스에 액세스를 참조하세요.

이 클래스에서 파생된 Managed C++ 사용자 관련 참고 사항:

  • 소멸자가 아닌 (켜기)(시작)닫기(및/또는 OnAbort)에 클린 코드를 넣습니다.

  • 소멸자 방지: 컴파일러에서 를 자동으로 생성 IDisposable합니다.

  • 참조가 아닌 멤버를 사용하지 않도록 합니다. 컴파일러에서 를 자동으로 생성 IDisposable할 수 있습니다.

  • 종료자 방지; 그러나 빌드 경고를 표시하지 않고 (켜기)(시작)닫기(및/또는 OnAbort)에서 종료자 자체를 호출 SuppressFinalize(Object) 하여 자동 생성된 IDisposable 동작을 에뮬레이트해야 합니다.

생성자

ClientBase<TChannel>()

애플리케이션 구성 파일의 기본 대상 엔드포인트를 사용하여 ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(Binding, EndpointAddress)

지정된 바인딩 및 대상 주소를 사용하여 ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext)

ClientBase<TChannel>를 이중 대화의 콜백 개체로 사용하여 callbackInstance 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext, Binding, EndpointAddress)

ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext, ServiceEndpoint)

지정된 ClientBase<TChannel>InstanceContext 개체를 사용하여 ServiceEndpoint 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext, String)

지정된 콜백 서비스 및 엔드포인트 구성 정보를 사용하여 ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext, String, EndpointAddress)

ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(InstanceContext, String, String)

ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(ServiceEndpoint)

지정된 ClientBase<TChannel>를 사용하여 ServiceEndpoint 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(String)

애플리케이션 구성 파일에서 ClientBase<TChannel>에 의해 지정된 구성 정보를 사용하여 endpointConfigurationName 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(String, EndpointAddress)

지정된 대상 주소 및 엔드포인트 정보를 사용하여 ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

ClientBase<TChannel>(String, String)

ClientBase<TChannel> 클래스의 새 인스턴스를 초기화합니다.

속성

CacheSetting

캐시 설정을 가져오거나 설정합니다.

Channel

다양하게 구성된 서비스 엔드포인트로 메시지를 보내는 데 사용되는 내부 채널을 가져옵니다.

ChannelFactory

내부 ChannelFactory<TChannel> 개체를 가져옵니다.

ClientCredentials

작업 호출에 사용되는 클라이언트 자격 증명을 가져옵니다.

Endpoint

WCF 클라이언트가 연결할 수 있는 서비스의 대상 엔드포인트를 가져옵니다.

InnerChannel

내부 IClientChannel 구현을 가져옵니다.

State

ClientBase<TChannel> 개체의 현재 상태를 가져옵니다.

메서드

Abort()

ClientBase<TChannel> 개체가 즉시 현재 상태에서 Closed 상태로 전환되도록 합니다.

Close()

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

CloseAsync()

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

CreateChannel()

서비스에 대한 새 채널을 반환합니다.

DisplayInitializationUI()

채널을 초기화하는 데 사용자 인터페이스가 필요한 경우 채널을 사용하기 전에 내부 채널이 사용자 인터페이스를 표시하도록 합니다.

Equals(Object)

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

(다음에서 상속됨 Object)
GetDefaultValueForInitialization<T>()

C#에서 기본 키워드의 동작을 복제합니다.

GetHashCode()

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

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

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

(다음에서 상속됨 Object)
InvokeAsync(ClientBase<TChannel>.BeginOperationDelegate, Object[], ClientBase<TChannel>.EndOperationDelegate, SendOrPostCallback, Object)

이벤트 기반 비동기 패턴을 구현하도록 지원합니다. 이 패턴에 대한 자세한 내용은 이벤트 기반 비동기 패턴 개요를 참조하세요.

MemberwiseClone()

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

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

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환되도록 합니다.

OpenAsync()

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IAsyncDisposable.DisposeAsync()

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

ICommunicationObject.BeginClose(AsyncCallback, Object)

ClientBase<TChannel>를 닫기 위한 비동기 작업을 시작합니다.

ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object)

지정된 시간 제한 내에 ClientBase<TChannel>를 닫기 위한 비동기 작업을 시작합니다.

ICommunicationObject.BeginOpen(AsyncCallback, Object)

ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 시작합니다.

ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object)

지정된 시간 간격 내에 ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 시작합니다.

ICommunicationObject.Close()

통신 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

ICommunicationObject.Close(TimeSpan)

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되도록 합니다.

ICommunicationObject.Closed

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환되었을 때 호출되는 이벤트 처리기입니다.

ICommunicationObject.Closing

ClientBase<TChannel> 개체가 현재 상태에서 Closed 상태로 전환될 때 호출되는 이벤트 처리기입니다.

ICommunicationObject.EndClose(IAsyncResult)

ClientBase<TChannel> 개체를 닫기 위한 비동기 작업을 완료합니다.

ICommunicationObject.EndOpen(IAsyncResult)

ClientBase<TChannel> 개체를 열기 위한 비동기 작업을 완료합니다.

ICommunicationObject.Faulted

ClientBase<TChannel> 개체에 대해 작업을 수행하는 도중 오류가 발생하면 호출되는 이벤트 처리기입니다.

ICommunicationObject.Open()

통신 개체가 Created 상태에서 Opened 상태로 전환되도록 합니다.

ICommunicationObject.Open(TimeSpan)

ClientBase<TChannel> 개체가 지정된 시간 간격 내에 Created 상태에서 Opened 상태로 전환되도록 합니다.

ICommunicationObject.Opened

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환될 때 호출되는 이벤트 처리기입니다.

ICommunicationObject.Opening

ClientBase<TChannel> 개체가 Created 상태에서 Opened 상태로 전환될 때 호출되는 이벤트 처리기입니다.

IDisposable.Dispose()

Dispose() 메서드의 명시적 구현입니다.

확장 메서드

CloseHelperAsync(ICommunicationObject, TimeSpan)

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

OpenHelperAsync(ICommunicationObject, TimeSpan)

서비스를 호출할 수 있는 WCF(Windows Communication Foundation) 클라이언트 개체를 만들 때 사용되는 기본 구현을 제공합니다.

ConfigureAwait(IAsyncDisposable, Boolean)

비동기 일회용에서 반환되는 작업을 대기하는 방법을 구성합니다.

적용 대상