HttpTransportBindingElement 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
메시지를 전송하기 위한 HTTP 전송을 지정하는 데 사용되는 바인딩 요소를 나타냅니다.
public ref class HttpTransportBindingElement : System::ServiceModel::Channels::TransportBindingElement
public ref class HttpTransportBindingElement : System::ServiceModel::Channels::TransportBindingElement, System::ServiceModel::Description::IPolicyExportExtension, System::ServiceModel::Description::IWsdlExportExtension
public class HttpTransportBindingElement : System.ServiceModel.Channels.TransportBindingElement
public class HttpTransportBindingElement : System.ServiceModel.Channels.TransportBindingElement, System.ServiceModel.Description.IPolicyExportExtension, System.ServiceModel.Description.IWsdlExportExtension
type HttpTransportBindingElement = class
inherit TransportBindingElement
type HttpTransportBindingElement = class
inherit TransportBindingElement
interface IWsdlExportExtension
interface IPolicyExportExtension
Public Class HttpTransportBindingElement
Inherits TransportBindingElement
Public Class HttpTransportBindingElement
Inherits TransportBindingElement
Implements IPolicyExportExtension, IWsdlExportExtension
- 상속
- 파생
- 구현
예제
다음 코드에서는 명령적으로 HttpTransportBindingElement.
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
HttpTransportBindingElement 는 다음 구성과 같이 구성 파일에서도 사용할 수 있습니다.
<bindings>
<customBinding>
<binding name="Binding1">
<reliableSession acknowledgementInterval="00:00:00.2000000" enableFlowControl="true"
maxTransferWindowSize="32" inactivityTimeout="00:10:00" maxPendingChannels="128"
maxRetryCount="8" ordered="true" />
<security mode="None"/>
<httpTransport authenticationScheme="Anonymous" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard"
proxyAuthenticationScheme="Anonymous" realm=""
useDefaultWebProxy="true" />
</binding>
</customBinding>
</bindings>
설명
이 HttpTransportBindingElement 클래스는 HTTP 전송 프로토콜을 구현하는 사용자 지정 바인딩을 만들기 위한 시작점입니다. HTTP는 상호 운용성을 위해 사용되는 기본 전송입니다. 이 전송은 다른 비 WCF 웹 서비스 스택과의 상호 운용성을 보장하기 위해 WCF(Windows Communication Foundation)에서 지원됩니다.
WCF 서비스 모델은 이 클래스를 사용하여 및 인터페이스를 구현하는 팩터리 개체를 IChannelFactoryIChannelListener 만듭니다. 이러한 팩터리 개체는 차례로 HTTP 프로토콜을 사용하여 SOAP 메시지를 전송하는 채널 및 수신기를 만듭니다.
등의 속성을 AuthenticationSchemeHostNameComparisonMode설정하여 이 클래스가 만드는 팩터리를 구성합니다MaxBufferSize.
기본 클래스 TransportBindingElement(예 ManualAddressing: , MaxReceivedMessageSize및 MaxBufferPoolSize)에서 속성을 설정할 수도 있습니다. 속성의 전체 목록은 다음을 참조하세요 TransportBindingElement.
생성자
| Name | Description |
|---|---|
| HttpTransportBindingElement() |
HttpTransportBindingElement 클래스의 새 인스턴스를 초기화합니다. |
| HttpTransportBindingElement(HttpTransportBindingElement) |
다른 바인딩 요소를 사용하여 클래스의 새 인스턴스를 HttpTransportBindingElement 초기화합니다. |
속성
| Name | Description |
|---|---|
| AllowCookies |
클라이언트가 쿠키를 수락하고 향후 요청에 전파하는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| AuthenticationScheme |
HTTP 수신기에서 처리 중인 클라이언트 요청을 인증하는 데 사용되는 인증 체계를 가져오거나 설정합니다. |
| BypassProxyOnLocal |
프록시가 로컬 주소에 대해 무시되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| DecompressionEnabled |
압축된 메시지 데이터를 원래 크기 및 형식으로 반환하는 프로세스를 사용할 수 있는지 여부를 가져오거나 설정합니다. |
| ExtendedProtectionPolicy |
들어오는 클라이언트 연결의 유효성을 검사하기 위해 서버에서 사용하는 확장 보안 정책의 값을 가져오거나 설정합니다. |
| HostNameComparisonMode |
URI에서 일치시킬 때 호스트 이름이 서비스에 도달하는 데 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| KeepAliveEnabled |
서비스 엔드포인트에 영구적으로 연결할지 여부를 나타내는 값을 가져오거나 설정합니다. |
| ManualAddressing |
메시지의 수동 주소 지정이 필요한지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 TransportBindingElement) |
| MaxBufferPoolSize |
전송에 사용되는 버퍼 풀의 최대 크기(바이트)를 가져오거나 설정합니다. (다음에서 상속됨 TransportBindingElement) |
| MaxBufferSize |
사용할 버퍼의 최대 크기를 가져오거나 설정합니다. 버퍼링된 메시지의 경우 이 값은 .MaxReceivedMessageSize 스트리밍된 메시지의 경우 이 값은 버퍼링 모드에서 읽어야 하는 SOAP 헤더의 최대 크기입니다. |
| MaxPendingAccepts |
서비스에서 동시에 허용할 수 있는 최대 연결 수를 가져오거나 설정합니다. |
| MaxReceivedMessageSize |
수신할 수 있는 최대 허용 메시지 크기(바이트)를 가져오거나 설정합니다. (다음에서 상속됨 TransportBindingElement) |
| MessageHandlerFactory |
Http 전송 메시지 처리기 팩터리를 가져오거나 설정합니다. |
| Proxy |
메시지를 전송하기 위한 HTTP 전송을 지정하는 데 사용되는 바인딩 요소를 나타냅니다. |
| ProxyAddress |
HTTP 요청에 사용할 프록시의 주소가 포함된 URI를 가져오거나 설정합니다. |
| ProxyAuthenticationScheme |
HTTP 프록시에서 처리 중인 클라이언트 요청을 인증하는 데 사용되는 인증 체계를 가져오거나 설정합니다. |
| Realm |
인증 영역을 가져오거나 설정합니다. |
| RequestInitializationTimeout |
요청된 초기화 시간 초과를 가져오거나 설정합니다. |
| Scheme |
전송에 대한 URI 체계를 가져옵니다. |
| TransferMode |
전송 모드를 가져오거나 설정합니다. |
| UnsafeConnectionNtlmAuthentication |
서버에서 안전하지 않은 연결 공유를 사용할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다. 사용하도록 설정하면 각 TCP 연결에서 NTLM 인증이 한 번 수행됩니다. |
| UseDefaultWebProxy |
사용자별 설정이 아닌 컴퓨터 전체 프록시 설정이 사용되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
| WebSocketSettings |
바인딩 요소의 웹 소켓 구성을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| BuildChannelFactory<TChannel>(BindingContext) |
채널을 만드는 데 사용할 수 있는 채널 팩터리를 만듭니다. |
| BuildChannelListener<TChannel>(BindingContext) |
지정된 형식의 채널 수신기를 만듭니다. |
| CanBuildChannelFactory<TChannel>(BindingContext) |
지정된 형식의 채널 팩터리를 빌드할 수 있는지 여부를 결정합니다. |
| CanBuildChannelListener<TChannel>(BindingContext) |
지정된 형식의 채널 수신기를 빌드할 수 있는지 여부를 결정합니다. |
| Clone() |
현재 바인딩 요소의 복사본인 새 인스턴스를 만듭니다. |
| Equals(Object) |
지정된 개체가 현재 개체와 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| GetHashCode() |
기본 해시 함수로 사용됩니다. (다음에서 상속됨 Object) |
| GetProperty<T>(BindingContext) |
지정된 BindingContext.에서 속성을 가져옵니다. |
| GetType() |
현재 인스턴스의 Type 가져옵니다. (다음에서 상속됨 Object) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| ShouldSerializeExtendedProtectionPolicy() |
확장된 보호 정책을 XAML로 직렬화할 수 없다는 값을 반환합니다. |
| ShouldSerializeMessageHandlerFactory() |
메시지 처리기 팩터리를 serialize해야 하는지 여부를 결정합니다. |
| ShouldSerializeWebSocketSettings() |
웹 소켓 설정을 serialize해야 하는지 여부를 결정합니다. |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
| UpdateAuthenticationSchemes(BindingContext) |
바인딩 컨텍스트를 포함하는 전송 인증 체계를 업데이트합니다. |
명시적 인터페이스 구현
| Name | Description |
|---|---|
| IPolicyExportExtension.ExportPolicy(MetadataExporter, PolicyConversionContext) |
바인딩에 대한 사용자 지정 정책 어설션을 내보냅니다. |
| IWsdlExportExtension.ExportContract(WsdlExporter, WsdlContractConversionContext) |
계약에 대해 생성된 WSDL에 사용자 지정 WSDL(Web Services Description Language) 요소를 씁니다. |
| IWsdlExportExtension.ExportEndpoint(WsdlExporter, WsdlEndpointConversionContext) |
엔드포인트에 대해 생성된 WSDL에 사용자 지정 WSDL(Web Services Description Language) 요소를 씁니다. |