WSHttpBindingBase 클래스

정의

기본 클래스에 공통 멤버 및 WSHttpBinding.에 공통 멤버를 WSFederationHttpBinding 제공합니다.

public ref class WSHttpBindingBase abstract : System::ServiceModel::Channels::Binding
public ref class WSHttpBindingBase abstract : System::ServiceModel::Channels::Binding, System::ServiceModel::Channels::IBindingRuntimePreferences
public abstract class WSHttpBindingBase : System.ServiceModel.Channels.Binding
public abstract class WSHttpBindingBase : System.ServiceModel.Channels.Binding, System.ServiceModel.Channels.IBindingRuntimePreferences
type WSHttpBindingBase = class
    inherit Binding
type WSHttpBindingBase = class
    inherit Binding
    interface IBindingRuntimePreferences
Public MustInherit Class WSHttpBindingBase
Inherits Binding
Public MustInherit Class WSHttpBindingBase
Inherits Binding
Implements IBindingRuntimePreferences
상속
WSHttpBindingBase
파생
구현

예제

다음 예제에서는 클래스에서 제공하는 WSHttpBindingBase 기능을 파생 클래스와 함께 사용하는 방법을 보여 줍니다 WSHttpBindingWSFederationHttpBinding.


// Define a service contract for the calculator.
[ServiceContract()]
public interface ICalculator
{
    [OperationContract(IsOneWay = false)]
    double Add(double n1, double n2);
    [OperationContract(IsOneWay = false)]
    double Subtract(double n1, double n2);
    [OperationContract(IsOneWay = false)]
    double Multiply(double n1, double n2);
    [OperationContract(IsOneWay = false)]
    double Divide(double n1, double n2);
}

// Service class which implements the service contract.
public class CalculatorService : ICalculator
{
    public double Add(double n1, double n2)
    {
        double result = n1 + n2;
        return result;
    }

    public double Subtract(double n1, double n2)
    {
        double result = n1 - n2;
        return result;
    }

    public double Multiply(double n1, double n2)
    {
        double result = n1 * n2;
        return result;
    }

    public double Divide(double n1, double n2)
    {
        double result = n1 / n2;
        return result;
    }

    // Create and configure bindings within this EXE console application.
    public static void Main()
    {
        // Create a WSHttpBinding
        WSHttpBinding binding1 = new WSHttpBinding();

    binding1.BypassProxyOnLocal =  true;

    EnvelopeVersion envelopeVersion =
    binding1.EnvelopeVersion;

    HostNameComparisonMode hostnameComparisonMode =
    binding1.HostNameComparisonMode;

    long maxBufferPoolSize =
        binding1.MaxBufferPoolSize;

    long maxReceivedMessageSize =
    binding1.MaxReceivedMessageSize;

    WSMessageEncoding messageEncoding =
    binding1.MessageEncoding;

    Uri proxyAddress =
        binding1.ProxyAddress;

    XmlDictionaryReaderQuotas readerQuotas =
    binding1.ReaderQuotas;

    OptionalReliableSession reliableSession =
    binding1.ReliableSession;

    string scheme = binding1.Scheme;

    Encoding textEncoding =
        binding1.TextEncoding;

    bool transactionFlow =
        binding1.TransactionFlow;

    bool useDefaultWebProxy =
        binding1.UseDefaultWebProxy;

    BindingElementCollection bindingElements =
            binding1.CreateBindingElements();

        // Set WSHttpBinding binding property values
        binding1.Name = "Binding1";
        binding1.HostNameComparisonMode =
           HostNameComparisonMode.StrongWildcard;
        binding1.Security.Mode = SecurityMode.Message;
        binding1.ReliableSession.Enabled = false;
        binding1.TransactionFlow = false;
       // binding1.Security.Message.DefaultProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;

        // Enumerate properties of the binding1.
        Console.WriteLine("WSHttpBinding binding1 properties:");
        Console.WriteLine("      - name:\t\t\t{0}", binding1.Name);
        Console.WriteLine("      - hostname comparison:\t{0}", binding1.HostNameComparisonMode);
        Console.WriteLine("      - security mode:\t\t{0}", binding1.Security.Mode);
        Console.WriteLine("      - RM enabled:\t\t{0}", binding1.ReliableSession.Enabled);
        Console.WriteLine("      - transaction flow:\t{0}", binding1.TransactionFlow);
        //Console.WriteLine("      - message security:\t{0}", binding1.Security.Message.DefaultProtectionLevel);
        Console.WriteLine("      - transport scheme:\t{0}", binding1.Scheme);
        Console.WriteLine("      - max message size:\t{0}", binding1.MaxReceivedMessageSize);
        Console.WriteLine("      - default text encoding:\t{0}", binding1.TextEncoding);
        Console.WriteLine();

        // Create a WSFederationBinding with a message security mode
        // and with a reliable session enabled.
        WSFederationHttpBinding binding3 = new WSFederationHttpBinding(WSFederationHttpSecurityMode.Message, true);

        // Enumerate properties of the binding2.
        Console.WriteLine("WSFederationBinding binding3 properties:");
        Console.WriteLine("      - security mode:\t\t{0}", binding3.Security.Mode);
        Console.WriteLine("      - RM enabled:\t\t{0}", binding3.ReliableSession.Enabled);
        Console.WriteLine();
        Console.WriteLine("Press <ENTER> to terminate.");
        Console.ReadLine();
    }

static void SnippetReceiveSynchronously ()
{
    WSHttpBinding binding = new WSHttpBinding();
    IBindingRuntimePreferences s  =
                       binding.GetProperty<IBindingRuntimePreferences>
                       (new BindingParameterCollection());
    bool receiveSynchronously = s.ReceiveSynchronously;
}
}

' Define a service contract for the calculator.
<ServiceContract()> _
Public Interface ICalculator
    <OperationContract(IsOneWay := False)> _
    Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double
    <OperationContract(IsOneWay := False)> _
    Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double
    <OperationContract(IsOneWay := False)> _
    Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double
    <OperationContract(IsOneWay := False)> _
    Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double
End Interface

' Service class which implements the service contract.
Public Class CalculatorService
    Implements ICalculator
    Public Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double Implements ICalculator.Add
        Dim result = n1 + n2
        Return result
    End Function

    Public Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double Implements ICalculator.Subtract
        Dim result = n1 - n2
        Return result
    End Function

    Public Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double Implements ICalculator.Multiply
        Dim result = n1 * n2
        Return result
    End Function

    Public Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double Implements ICalculator.Divide
        Dim result = n1 / n2
        Return result
    End Function

    ' Create and configure bindings within this EXE console application.
    Public Shared Sub Main()
        ' Create a WSHttpBinding
        Dim binding1 As New WSHttpBinding()

    binding1.BypassProxyOnLocal = True

    Dim envelopeVersion As EnvelopeVersion = binding1.EnvelopeVersion

    Dim hostnameComparisonMode As HostNameComparisonMode = binding1.HostNameComparisonMode

        Dim maxBufferPoolSize = binding1.MaxBufferPoolSize


        Dim maxReceivedMessageSize = binding1.MaxReceivedMessageSize

    Dim messageEncoding As WSMessageEncoding = binding1.MessageEncoding

    Dim proxyAddress As Uri = binding1.ProxyAddress

    Dim readerQuotas As XmlDictionaryReaderQuotas = binding1.ReaderQuotas

    Dim reliableSession As OptionalReliableSession = binding1.ReliableSession

        Dim scheme = binding1.Scheme

        Dim textEncoding = binding1.TextEncoding

        Dim transactionFlow = binding1.TransactionFlow

        Dim useDefaultWebProxy = binding1.UseDefaultWebProxy

    Dim bindingElements As BindingElementCollection = binding1.CreateBindingElements()

        ' Set WSHttpBinding binding property values
        binding1.Name = "Binding1"
        binding1.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard
        binding1.Security.Mode = SecurityMode.Message
        binding1.ReliableSession.Enabled = False
        binding1.TransactionFlow = False
       ' binding1.Security.Message.DefaultProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;

        ' Enumerate properties of the binding1.
        Console.WriteLine("WSHttpBinding binding1 properties:")
        Console.WriteLine("      - name:" & Constants.vbTab + Constants.vbTab + Constants.vbTab & "{0}", binding1.Name)
        Console.WriteLine("      - hostname comparison:" & Constants.vbTab & "{0}", binding1.HostNameComparisonMode)
        Console.WriteLine("      - security mode:" & Constants.vbTab + Constants.vbTab & "{0}", binding1.Security.Mode)
        Console.WriteLine("      - RM enabled:" & Constants.vbTab + Constants.vbTab & "{0}", binding1.ReliableSession.Enabled)
        Console.WriteLine("      - transaction flow:" & Constants.vbTab & "{0}", binding1.TransactionFlow)
        'Console.WriteLine("      - message security:\t{0}", binding1.Security.Message.DefaultProtectionLevel);
        Console.WriteLine("      - transport scheme:" & Constants.vbTab & "{0}", binding1.Scheme)
        Console.WriteLine("      - max message size:" & Constants.vbTab & "{0}", binding1.MaxReceivedMessageSize)
        Console.WriteLine("      - default text encoding:" & Constants.vbTab & "{0}", binding1.TextEncoding)
        Console.WriteLine()

        ' Create a WSFederationBinding with a message security mode
        ' and with a reliable session enabled.
        Dim binding3 As New WSFederationHttpBinding(WSFederationHttpSecurityMode.Message, True)

        ' Enumerate properties of the binding2.
        Console.WriteLine("WSFederationBinding binding3 properties:")
        Console.WriteLine("      - security mode:" & Constants.vbTab + Constants.vbTab & "{0}", binding3.Security.Mode)
        Console.WriteLine("      - RM enabled:" & Constants.vbTab + Constants.vbTab & "{0}", binding3.ReliableSession.Enabled)
        Console.WriteLine()
        Console.WriteLine("Press <ENTER> to terminate.")
        Console.ReadLine()

    End Sub

Private Shared Sub SnippetReceiveSynchronously()
    Dim binding As New WSHttpBinding()
    Dim s As IBindingRuntimePreferences = binding.GetProperty(Of IBindingRuntimePreferences) (New BindingParameterCollection())
        Dim receiveSynchronously = s.ReceiveSynchronously

End Sub

End Class

설명

보안 WSHttpBindingBase , 안정성 및 상호 운용 가능한 웹 서비스를 구성하는 데 사용되는 바인딩에 대한 몇 가지 기본 기능(예: 이중이 아닌 서비스 계약용으로 구현됨 WSHttpBinding ) 특히 WS-Federation 프로토콜을 지원하는 보안 및 상호 운용성을 WSFederationHttpBinding 위한 몇 가지 기본 기능을 제공합니다.

기본적으로 메시지 보안 및 인증에 WS-Security, 메시지 배달을 위한 HTTP 및 텍스트/XML 메시지 인코딩을 사용하는 런타임 스택을 생성합니다. 안정성을 위해 WS-ReliableMessaging 사용하도록 구성할 수도 있습니다.

WS-ReliableMessaging 사용은 선택적 reliableSessionEnabled 매개 변수를 사용하여 구성할 수 있습니다.

생성자

Name Description
WSHttpBindingBase()

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

WSHttpBindingBase(Boolean)

신뢰할 수 있는 세션을 사용할 수 있는지 여부를 나타내는 값을 사용하여 클래스의 WSHttpBindingBase 새 인스턴스를 초기화합니다.

속성

Name Description
BypassProxyOnLocal

로컬 주소에 대한 프록시 서버를 무시할지 여부를 나타내는 값을 가져오거나 설정합니다.

CloseTimeout

전송에서 예외가 발생하기 전에 연결이 닫히기 위해 제공된 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
EnvelopeVersion

이 바인딩에서 처리되는 메시지에 사용되는 SOAP의 버전을 가져옵니다.

HostNameComparisonMode

URI를 일치시킬 때 호스트 이름이 서비스에 도달하는 데 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다.

MaxBufferPoolSize

이 바인딩을 사용하여 엔드포인트에 필요한 버퍼를 관리하는 버퍼 관리자에 할당된 최대 메모리 양을 바이트 단위로 가져오거나 설정합니다.

MaxReceivedMessageSize

바인딩에서 처리할 수 있는 메시지의 최대 크기(바이트)를 가져오거나 설정합니다.

MessageEncoding

MTOM 또는 Text/XML을 사용하여 SOAP 메시지를 인코딩할지 여부를 가져오거나 설정합니다.

MessageVersion

바인딩으로 구성된 클라이언트 및 서비스에서 사용하는 메시지 버전을 가져옵니다.

(다음에서 상속됨 Binding)
Name

바인딩의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
Namespace

바인딩의 XML 네임스페이스를 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
OpenTimeout

전송에서 예외가 발생하기 전에 연결이 열리도록 제공된 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
ProxyAddress

HTTP 프록시의 URI 주소를 가져오거나 설정합니다.

ReaderQuotas

이 바인딩으로 구성된 엔드포인트에서 처리할 수 있는 SOAP 메시지의 복잡성에 대한 제약 조건을 가져오거나 설정합니다.

ReceiveTimeout

연결을 끊기 전에 애플리케이션 메시지가 수신되지 않는 동안 연결이 비활성 상태로 유지될 수 있는 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
ReliableSession

시스템 제공 바인딩 중 하나를 사용할 때 사용할 수 있는 신뢰할 수 있는 세션 바인딩 요소의 속성에 편리하게 액세스할 수 있는 개체를 가져옵니다.

Scheme

이 바인딩으로 구성된 채널 및 수신기에 대한 URI 전송 체계를 가져옵니다.

SendTimeout

전송에서 예외가 발생하기 전에 쓰기 작업이 완료될 때까지 제공되는 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
TextEncoding

메시지 텍스트에 사용되는 문자 인코딩을 가져오거나 설정합니다.

TransactionFlow

이 바인딩이 흐름 WS-트랜잭션을 지원해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

UseDefaultWebProxy

사용 가능한 경우 시스템의 자동 구성된 HTTP 프록시를 사용해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

Name Description
BuildChannelFactory<TChannel>(BindingParameterCollection)

지정된 유형의 채널을 만들고 바인딩 매개 변수 컬렉션에서 지정한 기능을 충족하는 채널 팩터리 스택을 클라이언트에 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelFactory<TChannel>(Object[])

지정된 유형의 채널을 만들고 개체 배열에서 지정한 기능을 충족하는 채널 팩터리 스택을 클라이언트에 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(BindingParameterCollection)

지정된 유형의 채널을 허용하고 바인딩 매개 변수 컬렉션에서 지정한 기능을 충족하는 서비스에 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
CanBuildChannelFactory<TChannel>(BindingParameterCollection)

현재 바인딩이 지정된 바인딩 매개 변수 컬렉션을 충족하는 채널 팩터리 스택을 클라이언트에 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelFactory<TChannel>(Object[])

현재 바인딩이 개체 배열에서 지정한 요구 사항을 충족하는 채널 팩터리 스택을 클라이언트에 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelListener<TChannel>(BindingParameterCollection)

현재 바인딩이 지정된 바인딩 매개 변수 컬렉션을 충족하는 서비스에서 채널 수신기 스택을 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelListener<TChannel>(Object[])

현재 바인딩이 개체 배열에 지정된 조건을 충족하는 서비스에서 채널 수신기 스택을 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CreateBindingElements()

현재 바인딩에 포함된 바인딩 요소의 순서가 지정된 컬렉션을 반환합니다.

CreateMessageSecurity()

파생 클래스에서 구현된 경우 현재 바인딩에서 반환 SecurityBindingElement 합니다.

Equals(Object)

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

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

기본 해시 함수로 사용됩니다.

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

바인딩 스택의 적절한 계층에서 요청된 형식화된 개체(있는 경우)를 반환합니다.

(다음에서 상속됨 Binding)
GetTransport()

파생 클래스에서 구현되는 경우 현재 바인딩에서 전송 바인딩 요소를 반환합니다.

GetType()

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

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

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

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

바인딩의 이름을 serialize해야 하는지 여부를 반환합니다.

(다음에서 상속됨 Binding)
ShouldSerializeNamespace()

바인딩의 네임스페이스를 serialize해야 하는지 여부를 반환합니다.

(다음에서 상속됨 Binding)
ShouldSerializeReaderQuotas()

속성이 기본값에서 변경되어 serialize되어야 하는지 여부를 ReaderQuotas 나타내는 값을 반환합니다.

ShouldSerializeReliableSession()

속성이 기본값에서 변경되어 serialize되어야 하는지 여부를 ReliableSession 나타내는 값을 반환합니다.

ShouldSerializeTextEncoding()

속성이 기본값에서 변경되어 serialize되어야 하는지 여부를 TextEncoding 나타내는 값을 반환합니다.

ToString()

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

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
IBindingRuntimePreferences.ReceiveSynchronously

들어오는 요청이 동기적으로 처리되는지 비동기적으로 처리되는지 여부를 나타내는 값을 가져옵니다.

적용 대상