다음을 통해 공유


ClientBase<TChannel> 클래스

정의

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

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
generic <typename TChannel>
 where TChannel : classpublic ref class ClientBase abstract : IDisposable, System::ServiceModel::ICommunicationObject
public abstract class ClientBase<TChannel> : System.ServiceModel.ICommunicationObject where TChannel : class
public abstract class ClientBase<TChannel> : IAsyncDisposable, IDisposable, System.ServiceModel.ICommunicationObject where TChannel : class
public abstract class ClientBase<TChannel> : IDisposable, System.ServiceModel.ICommunicationObject where TChannel : class
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
Public MustInherit Class ClientBase(Of TChannel)
Implements IAsyncDisposable, ICommunicationObject, IDisposable
Public MustInherit Class ClientBase(Of TChannel)
Implements 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 클라이언트사용하여 서비스에 액세스하는 참조하세요.

이 클래스에서 파생되는 관리되는 C++ 사용자를 위한 특별 참고 사항:

  • 소멸자가 아닌 정리 코드를 (On)(Begin)Close(및/또는 OnAbort)에 넣습니다.

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

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

  • 종료자를 사용하지 않습니다. 그러나 빌드 경고를 표시하지 않고 (On)(Begin)Close(및/또는 OnAbort)에서 SuppressFinalize(Object) 및 종료자 자체를 호출하여 자동으로 생성된 IDisposable 동작을 에뮬레이트해야 합니다.

생성자

ClientBase<TChannel>()

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

ClientBase<TChannel>(Binding, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext)

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

ClientBase<TChannel>(InstanceContext, Binding, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext, ServiceEndpoint)

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

ClientBase<TChannel>(InstanceContext, String)

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

ClientBase<TChannel>(InstanceContext, String, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext, String, String)

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

ClientBase<TChannel>(ServiceEndpoint)

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

ClientBase<TChannel>(String)

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

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> 개체가 현재 상태에서 닫힌 상태로 즉시 전환되도록 합니다.

Close()

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

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> 개체가 생성된 상태에서 열린 상태로 전환되도록 합니다.

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()

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

ICommunicationObject.Close(TimeSpan)

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

ICommunicationObject.Closed

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

ICommunicationObject.Closing

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

ICommunicationObject.EndClose(IAsyncResult)

비동기 작업을 완료하여 ClientBase<TChannel> 개체를 닫습니다.

ICommunicationObject.EndOpen(IAsyncResult)

비동기 작업을 완료하여 ClientBase<TChannel> 개체를 엽니다.

ICommunicationObject.Faulted

ClientBase<TChannel> 개체에서 작업을 수행하는 동안 오류가 발생할 때 호출되는 이벤트 처리기입니다.

ICommunicationObject.Open()

통신 개체가 생성된 상태에서 열린 상태로 전환되도록 합니다.

ICommunicationObject.Open(TimeSpan)

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

ICommunicationObject.Opened

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

ICommunicationObject.Opening

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

IDisposable.Dispose()

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

확장 메서드

CloseHelperAsync(ICommunicationObject, TimeSpan)

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

OpenHelperAsync(ICommunicationObject, TimeSpan)

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

ConfigureAwait(IAsyncDisposable, Boolean)

비동기 삭제 가능 파일에서 반환된 작업에 대한 대기가 수행되는 방법을 구성합니다.

적용 대상