BindingName Property

ChannelDispatcher.BindingName Property

 

Gets the name of the binding used to configure the service.

Namespace:   System.ServiceModel.Dispatcher
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public string BindingName { get; }

Property Value

Type: System.String

The binding name of the service.

Used to obtain the binding name for the binding with which this channel dispatcher is associated.

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

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

serviceHost.Open();

ChannelDispatcher dispatcher = (ChannelDispatcher) serviceHost.ChannelDispatchers[0];
string bindingName = dispatcher.BindingName;

.NET Framework
Available since 3.0
Return to top
Show:
© 2016 Microsoft