ReliableSessionBindingElement 클래스

정의

엔드포인트 간의 신뢰할 수 있는 세션에 필요한 발신 및 수신 채널을 생성할 수 있는 바인딩 요소를 나타냅니다.

public ref class ReliableSessionBindingElement sealed : System::ServiceModel::Channels::BindingElement
public ref class ReliableSessionBindingElement sealed : System::ServiceModel::Channels::BindingElement, System::ServiceModel::Description::IPolicyExportExtension
public sealed class ReliableSessionBindingElement : System.ServiceModel.Channels.BindingElement
public sealed class ReliableSessionBindingElement : System.ServiceModel.Channels.BindingElement, System.ServiceModel.Description.IPolicyExportExtension
type ReliableSessionBindingElement = class
    inherit BindingElement
type ReliableSessionBindingElement = class
    inherit BindingElement
    interface IPolicyExportExtension
Public NotInheritable Class ReliableSessionBindingElement
Inherits BindingElement
Public NotInheritable Class ReliableSessionBindingElement
Inherits BindingElement
Implements IPolicyExportExtension
상속
ReliableSessionBindingElement
구현

예제

ReliableSessionBindingElement 사용자 지정 바인딩에 추가할 수 있습니다. 이 작업은 다음 구성 요소를 사용하여 수행됩니다.

<bindings>  
    <customBinding>  
        <binding configurationName="ReliabilityHTTP">  
            <reliableSession/>  
        </binding>  
    </customBinding>  
</bindings>  

다음 샘플 코드는 코드에서 사용하는 ReliableSessionBindingElement 방법을 보여 줍니다.

Uri baseAddress = new Uri("http://localhost:8000/servicemodelsamples/service");

// Create a ServiceHost for the CalculatorService type and provide the base address.
using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress))
{
    // Create a custom binding that contains two binding elements.
    ReliableSessionBindingElement reliableSession = new ReliableSessionBindingElement();
    reliableSession.Ordered = true;

    HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
    httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous;
    httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard;

    CustomBinding binding = new CustomBinding(reliableSession, httpTransport);

    // Add an endpoint using that binding.
    serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, "");

    // Add a MEX endpoint.
    ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
    smb.HttpGetEnabled = true;
    smb.HttpGetUrl = new Uri("http://localhost:8001/servicemodelsamples");
    serviceHost.Description.Behaviors.Add(smb);

    // Open the ServiceHostBase to create listeners and start listening for messages.
    serviceHost.Open();

    // The service can now be accessed.
    Console.WriteLine("The service is ready.");
    Console.WriteLine("Press <ENTER> to terminate service.");
    Console.WriteLine();
    Console.ReadLine();

    // Close the ServiceHostBase to shutdown the service.
    serviceHost.Close();
}
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Using serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)
    ' Create a custom binding that contains two binding elements.
    Dim reliableSession As New ReliableSessionBindingElement()
    reliableSession.Ordered = True

    Dim httpTransport As New HttpTransportBindingElement()
    httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Anonymous
    httpTransport.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

    Dim binding As New CustomBinding(reliableSession, httpTransport)

    ' Add an endpoint using that binding.
    serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, "")

    ' Add a MEX endpoint.
    Dim smb As New ServiceMetadataBehavior()
    smb.HttpGetEnabled = True
    smb.HttpGetUrl = New Uri("http://localhost:8001/servicemodelsamples")
    serviceHost.Description.Behaviors.Add(smb)

    ' Open the ServiceHostBase to create listeners and start listening for messages.
    serviceHost.Open()

    ' The service can now be accessed.
    Console.WriteLine("The service is ready.")
    Console.WriteLine("Press <ENTER> to terminate service.")
    Console.WriteLine()
    Console.ReadLine()

    ' Close the ServiceHostBase to shutdown the service.
    serviceHost.Close()
End Using

설명

세션을 제공하고 필요에 따라 정렬된 메시지 배달을 제공합니다. 이 구현된 세션은 SOAP 및 전송 중개자 간에 교차할 수 있습니다.

각 바인딩 요소는 메시지를 보내거나 받을 때 처리 단계를 나타냅니다. 런타임에 바인딩 요소는 메시지를 보내고 받는 데 필요한 나가는 채널 및 들어오는 채널 스택을 빌드하는 데 필요한 채널 팩터리와 수신기를 만듭니다. 스택 ReliableSessionBindingElement 에서 엔드포인트 간에 신뢰할 수 있는 세션을 설정하고 이 세션의 동작을 구성할 수 있는 선택적 계층을 제공합니다.

다음 ReliableSessionBindingElement 표의 표준 바인딩에 제공됩니다.

바인딩 기본값
NetTcpBinding 끄기
WSHttpBinding 끄기
WSDualHttpBinding 켜기(필수)

생성자

ReliableSessionBindingElement()

ReliableSessionBindingElement 클래스의 새 인스턴스를 초기화합니다.

ReliableSessionBindingElement(Boolean)

메시지 배달 시 메시지를 보낸 순서를 유지할지 여부를 지정하는 ReliableSessionBindingElement 클래스의 새 인스턴스를 초기화합니다.

속성

AcknowledgementInterval

팩터리에서 만든 신뢰할 수 있는 채널의 메시지 소스에 승인을 보내기 전에 대상이 대기하는 시간을 가져오거나 설정합니다.

FlowControlEnabled

신뢰할 수 있는 세션에서 흐름 제어를 사용하는지 여부를 나타내는 값을 가져오거나 설정합니다.

InactivityTimeout

서비스가 특정 시간 동안 비활성 상태로 유지될 경우 서비스를 닫는 시간 간격을 가져오거나 설정합니다.

MaxPendingChannels

신뢰할 수 있는 세션 중에 보류할 수 있는 최대 채널 수를 가져오거나 설정합니다.

MaxRetryCount

신뢰할 수 있는 세션 중에 메시지를 전송하려고 시도하는 최대 횟수를 가져오거나 설정합니다.

MaxTransferWindowSize

전송 버퍼 또는 수신 버퍼에 보관할 수 있는 최대 메시지 수를 가져오거나 설정합니다.

Ordered

메시지 배달 시 메시지를 보낸 순서를 유지할지 여부를 나타내는 값을 가져오거나 설정합니다.

ReliableMessagingVersion

바인딩 요소에서 지정한 WS-ReliableMessaging 버전을 가져오거나 설정합니다.

메서드

BuildChannelFactory<TChannel>(BindingContext)

신뢰할 수 있는 세션을 지원하는 지정된 유형의 채널을 만드는 팩터리를 반환합니다.

BuildChannelListener<TChannel>(BindingContext)

신뢰할 수 있는 세션을 지원하는 지정된 형식의 채널을 수락하는 수신기를 반환합니다.

BuildChannelListener<TChannel>(BindingContext)

바인딩 컨텍스트를 사용하여 지정된 형식의 채널을 수락하기 위해 채널 수신기를 초기화합니다.

(다음에서 상속됨 BindingElement)
CanBuildChannelFactory<TChannel>(BindingContext)

제공된 채널 및 컨텍스트에 대해 신뢰할 수 있는 세션을 지원할 수 있는 채널 팩터리를 생성할 수 있는지 여부를 나타내는 값을 반환합니다.

CanBuildChannelListener<TChannel>(BindingContext)

제공된 채널 및 컨텍스트에 대해 신뢰할 수 있는 세션을 지원할 수 있는 채널 수신기를 생성할 수 있는지 여부를 나타내는 값을 반환합니다.

CanBuildChannelListener<TChannel>(BindingContext)

바인딩 요소에서 특정 채널 형식에 대한 수신기를 만들 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 BindingElement)
Clone()

현재 신뢰할 수 있는 세션 바인딩 요소의 복사본을 만듭니다.

Equals(Object)

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

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

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

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

바인딩 컨텍스트에서 지정된 형식의 속성을 가져옵니다.

GetType()

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

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

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

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

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext)

신뢰할 수 있는 세션 바인딩 요소에 포함된 정보를, 원격 엔드포인트에서 신뢰할 수 있는 세션을 통해 서비스에 액세스할 수 있도록 하는 WSDL 요소에 매핑합니다.

적용 대상