ClientRuntime 클래스

정의

클라이언트 애플리케이션에서 처리하는 모든 메시지에 대한 WCF(Windows Communication Foundation) 클라이언트 개체 기능을 확장하는 클래스의 삽입 지점을 나타냅니다.

public ref class ClientRuntime sealed
public ref class ClientRuntime sealed : System::ServiceModel::Dispatcher::ClientRuntimeCompatBase
public sealed class ClientRuntime
public sealed class ClientRuntime : System.ServiceModel.Dispatcher.ClientRuntimeCompatBase
type ClientRuntime = class
type ClientRuntime = class
    inherit ClientRuntimeCompatBase
Public NotInheritable Class ClientRuntime
Public NotInheritable Class ClientRuntime
Inherits ClientRuntimeCompatBase
상속
ClientRuntime
상속

예제

다음 코드 예제에서 System.ServiceModel.Description.IEndpointBehaviorSystem.ServiceModel.Dispatcher.IClientMessageInspectorMessageInspectors 속성에 추가하여 클라이언트 런타임에 삽입합니다.

#region IEndpointBehavior Members
public void AddBindingParameters(
  ServiceEndpoint endpoint, BindingParameterCollection bindingParameters
) { return; }

public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
  clientRuntime.MessageInspectors.Add(new Inspector());
  foreach (ClientOperation op in clientRuntime.Operations)
    op.ParameterInspectors.Add(new Inspector());
}

public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
  endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new Inspector());
  foreach (DispatchOperation op in endpointDispatcher.DispatchRuntime.Operations)
    op.ParameterInspectors.Add(new Inspector());
}

public void Validate(ServiceEndpoint endpoint){ return; }
#Region "IEndpointBehavior Members"
    Public Sub AddBindingParameters(ByVal endpoint As ServiceEndpoint, ByVal bindingParameters _
                                    As BindingParameterCollection) Implements IEndpointBehavior.AddBindingParameters
        Return
    End Sub

    Public Sub ApplyClientBehavior(ByVal endpoint As ServiceEndpoint, ByVal clientRuntime As ClientRuntime) _
    Implements IEndpointBehavior.ApplyClientBehavior
        clientRuntime.MessageInspectors.Add(New Inspector())
        For Each op As ClientOperation In clientRuntime.Operations
            op.ParameterInspectors.Add(New Inspector())
        Next op
    End Sub

    Public Sub ApplyDispatchBehavior(ByVal endpoint As ServiceEndpoint, ByVal endpointDispatcher As  _
                                     EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
        endpointDispatcher.DispatchRuntime.MessageInspectors.Add(New Inspector())
        For Each op As DispatchOperation In endpointDispatcher.DispatchRuntime.Operations
            op.ParameterInspectors.Add(New Inspector())
        Next op
    End Sub

Public Sub Validate(ByVal endpoint As ServiceEndpoint) Implements IEndpointBehavior.Validate
    Return
End Sub

다음 코드 예제에서는 엔드포인트 동작을 클라이언트 엔드포인트로 로드하는 구성 파일을 보여 줍니다.

  <client>
      <endpoint 
        address="http://localhost:8080/SampleService" 
        behaviorConfiguration="clientInspectorsAdded" 
        binding="wsHttpBinding"
        bindingConfiguration="WSHttpBinding_ISampleService" 
        contract="ISampleService"
        name="WSHttpBinding_ISampleService"
      >
      </endpoint>
  </client>
<behaviors>
  <endpointBehaviors>
    <behavior name="clientInspectorsAdded">
      <clientInterceptors />
    </behavior>
  </endpointBehaviors>
</behaviors>
<extensions>
  <behaviorExtensions>
    <add 
      name="clientInterceptors" 
      type="Microsoft.WCF.Documentation.InspectorInserter, HostApplication, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null"
  />
  </behaviorExtensions>
</extensions>

설명

WCF 클라이언트 개체의 확장 하는지 여부를 ClientBase<TChannel> 또는 IClientChannelWindows Communication Foundation (WCF) 클라이언트 애플리케이션에서 메서드 호출을 아웃 바운드 메시지로 변환 하 고 들어오는 메시지를 개체로 변환 하는 데 사용 되 고 전달 하는 클라이언트 메서드의 결과입니다.

ClientRuntime 클래스는 메시지를 가로채서 모든 작업에서 클라이언트 동작을 확장하는 확장명 개체를 추가할 수 있는 확장성 지점입니다. 가로채기 개체는 특정 계약의 모든 메시지를 처리하고, 특정 작업의 메시지만 처리하며, 사용자 지정 채널 초기화를 수행하고, 다른 사용자 지정 클라이언트 애플리케이션 동작을 구현할 수 있습니다. 클라이언트 아키텍처의 개요를 보려면 WCF 클라이언트 아키텍처합니다. 클라이언트 프로그래밍에 대 한 자세한 내용은 참조 하세요. WCF 클라이언트를 사용 하 여 액세스 서비스합니다. 사용자 지정 및 수행 하는 방법에 대 한 자세한 내용은 참조 하세요 확장 클라이언트합니다.

  • CallbackDispatchRuntime 속성은 서비스 개시 콜백 작업에 대한 디스패치 런타임 개체를 반환합니다.

  • OperationSelector 속성은 사용자 지정 작업 선택기 개체를 적용하여 클라이언트 메시지의 라우팅을 제어합니다.

  • ChannelInitializers 속성을 사용하면 클라이언트 채널을 검사하거나 수정할 수 있는 채널 이니셜라이저를 추가할 수 있습니다.

  • InteractiveChannelInitializers 속성을 사용하면 사용자가 채널을 열기 전에 자격 증명을 선택할 수 있도록 시각적 프롬프트를 표시할 수 있습니다.

  • Operations 속성은 해당 작업의 메시지에 특정한 기능을 제공하는 사용자 지정 메시지 인터셉터를 추가할 수 있는 ClientOperation 개체의 컬렉션을 가져옵니다.

  • ManualAddressing 속성을 사용하면 애플리케이션에서 일부 자동 주소 헤더를 비활성화하고 주소를 직접 제어할 수 있습니다.

  • MaxFaultSize 속성을 사용하면 클라이언트가 수락하는 오류 메시지의 크기를 제한할 수 있습니다.

  • MessageInspectors 속성은 클라이언트를 통해 이동하는 모든 메시지에 대한 사용자 지정 메시지 인터셉터를 추가할 수 있는 IClientMessageInspector 개체 컬렉션을 가져옵니다.

  • UnhandledClientOperation 속성은 예기치 않은 메시지가 전달되는 작업을 반환합니다.

  • ValidateMustUnderstand 속성은 MustUnderstand로 표시된 SOAP 헤더가 실제로 인식되었음을 확인해야 하는지 여부를 시스템에 알려 줍니다.

  • Via 속성은 중간 매개자와 기타 시나리오를 지원하도록 전송 수준에서 메시지 대상 값을 설정합니다.

또한 클라이언트 계약 정보를 검색하는 몇 가지 속성이 있습니다.

클라이언트가 이중 클라이언트인 경우 다음 속성도 클라이언트 형식과 런타임을 검색합니다.

속성

CallbackClientType

이중 클라이언트와 연결된 콜백 계약의 형식을 가져오거나 설정합니다.

CallbackDispatchRuntime

서비스 개시 작업을 디스패치하는 디스패치 런타임을 설정합니다.

ChannelInitializers

클라이언트와 연결된 채널을 사용자 지정하는 데 사용되는 채널 이니셜라이저 개체 컬렉션을 가져옵니다.

ClientMessageInspectors

특정 서비스 작업의 메시지를 보거나 수정하는 데 사용되는 메시지 검사자 개체의 컬렉션을 가져옵니다.

ClientOperations

특정 서비스 작업의 동작과 메시지를 검사하고 수정하는 확장 개체를 연결하는 데 사용되는 클라이언트 작업 개체의 컬렉션을 가져옵니다.

ContractClientType

클라이언트와 연결된 계약의 형식을 가져오거나 설정합니다.

ContractName

클라이언트와 연결된 계약 이름을 가져옵니다.

ContractNamespace

클라이언트와 연결된 계약의 네임스페이스를 가져옵니다.

InteractiveChannelInitializers

대화형 채널 이니셜라이저의 컬렉션을 가져옵니다.

ManualAddressing

클라이언트에서 요청/응답 메시지에 주소 헤더를 추가하는지 여부를 나타내는 값을 가져오거나 설정합니다.

MaxFaultSize

최대 오류 크기를 가져오거나 설정합니다.

MessageInspectors

클라이언트에 대한 메시지 검사자 구현 컬렉션을 가져옵니다.

MessageVersionNoneFaultsEnabled

MessageVersionNoneFaultsEnabled 속성이 설정되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

Operations

클라이언트에 대한 클라이언트 작업 컬렉션을 가져옵니다.

OperationSelector

IClientOperationSelector을 선택하는 데 사용할 수 있는 ClientOperation 구현을 가져오거나 설정합니다.

UnhandledClientOperation

ClientOperation 컬렉션에 해당 Operations이 없는 메서드에 대한 클라이언트 작업을 가져옵니다.

ValidateMustUnderstand

SOAP MustUnderstand 헤더 처리를 시스템에서 수행하는지 아니면 애플리케이션에서 수행하는지를 지정하는 값을 가져오거나 설정합니다.

Via

클라이언트를 통해 메시지를 보내는 데 사용되는 전송 주소를 가져오거나 설정합니다.

메서드

Equals(Object)

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상