다음을 통해 공유


ServiceEndpoint.Binding 속성

정의

서비스 엔드포인트의 바인딩을 가져오거나 설정합니다.

public:
 property System::ServiceModel::Channels::Binding ^ Binding { System::ServiceModel::Channels::Binding ^ get(); void set(System::ServiceModel::Channels::Binding ^ value); };
public System.ServiceModel.Channels.Binding Binding { get; set; }
member this.Binding : System.ServiceModel.Channels.Binding with get, set
Public Property Binding As Binding

속성 값

서비스 엔드포인트에 대한 Binding입니다.

예제

Uri baseAddress = new Uri("http://localhost:8001/Simple");
ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), baseAddress);

ServiceEndpoint endpoint = serviceHost.AddServiceEndpoint(
    typeof(ICalculator),
    new WSHttpBinding(),
    "CalculatorServiceObject");

Console.WriteLine("Service endpoint {0} contains the following:", endpoint.Name);
Console.WriteLine("Binding: {0}", endpoint.Binding.ToString());
Console.WriteLine("Contract: {0}", endpoint.Contract.ToString());
Console.WriteLine("ListenUri: {0}", endpoint.ListenUri.ToString());
Console.WriteLine("ListenUriMode: {0}", endpoint.ListenUriMode.ToString());
Dim baseAddress As New Uri("http://localhost:8001/Simple")
Dim serviceHost As New ServiceHost(GetType(CalculatorService), baseAddress)

Dim endpoint As ServiceEndpoint = serviceHost.AddServiceEndpoint(GetType(ICalculator), New WSHttpBinding(), "CalculatorServiceObject")

Console.WriteLine("Service endpoint {0} contains the following:", endpoint.Name)
Console.WriteLine("Binding: {0}", endpoint.Binding.ToString())
Console.WriteLine("Contract: {0}", endpoint.Contract.ToString())
Console.WriteLine("ListenUri: {0}", endpoint.ListenUri.ToString())
Console.WriteLine("ListenUriMode: {0}", endpoint.ListenUriMode.ToString())

설명

엔드포인트에 대한 바인딩은 bindings 요소의 구성 파일에서도 <지정할 수 있습니다> .

적용 대상