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 IDisposable
    interface ICommunicationObject
    interface IAsyncDisposable
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface ICommunicationObject
    interface IDisposable
type ClientBase<'Channel (requires 'Channel : null)> = class
    interface IDisposable
    interface ICommunicationObject
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될 수 있습니다.
  • 종료자를 사용하지 않습니다. 그러나 하나를 포함하는 경우 빌드 경고를 표시하지 않고 자동 생성된 SuppressFinalize(Object) 동작을 에뮬레이트하려면 (On)(Begin)Close(및/또는 OnAbort)에서 빌드 경고 및 호출 IDisposable 및 종료자 자체를 표시하지 않아야 합니다.

생성자

Name Description
ClientBase<TChannel>()

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

ClientBase<TChannel>(Binding, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext, Binding, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext, ServiceEndpoint)

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

ClientBase<TChannel>(InstanceContext, String, EndpointAddress)

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

ClientBase<TChannel>(InstanceContext, String, String)

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

ClientBase<TChannel>(InstanceContext, String)

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

ClientBase<TChannel>(InstanceContext)

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

ClientBase<TChannel>(ServiceEndpoint)

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

ClientBase<TChannel>(String, EndpointAddress)

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

ClientBase<TChannel>(String, String)

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

ClientBase<TChannel>(String)

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

속성

Name Description
CacheSetting

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

Channel

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

ChannelFactory

기본 개체를 ChannelFactory<TChannel> 가져옵니다.

ClientCredentials

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

Endpoint

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

InnerChannel

기본 구현을 IClientChannel 가져옵니다.

State

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

메서드

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

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
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() .

적용 대상