CustomBinding Konstruktoren

Definition

Initialisiert eine neue Instanz der CustomBinding-Klasse.

Überlädt

Name Beschreibung
CustomBinding()

Initialisiert eine neue Instanz der CustomBinding-Klasse.

CustomBinding(IEnumerable<BindingElement>)

Initialisiert eine neue Instanz der CustomBinding Klasse mit den Bindungselementen aus einem vollständigen Kanalstapel.

CustomBinding(Binding)

Initialisiert eine neue Instanz der CustomBinding Klasse aus den Werten einer angegebenen Bindung.

CustomBinding(BindingElement[])

Initialisiert eine neue Instanz der CustomBinding Klasse aus einem Array von Bindungselementen.

CustomBinding(String)

Initialisiert eine neue Instanz der CustomBinding-Klasse.

CustomBinding(String, String, BindingElement[])

Initialisiert eine neue Instanz der CustomBinding Klasse aus einem Array von Bindungselementen mit einem angegebenen Namen und Namespace.

CustomBinding()

Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs

Initialisiert eine neue Instanz der CustomBinding-Klasse.

public:
 CustomBinding();
public CustomBinding();
Public Sub New ()

Beispiele

Das folgende Beispiel zeigt, wie Sie den parameterlosen Konstruktor verwenden:

Gilt für:

CustomBinding(IEnumerable<BindingElement>)

Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs

Initialisiert eine neue Instanz der CustomBinding Klasse mit den Bindungselementen aus einem vollständigen Kanalstapel.

public:
 CustomBinding(System::Collections::Generic::IEnumerable<System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(System.Collections.Generic.IEnumerable<System.ServiceModel.Channels.BindingElement> bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : seq<System.ServiceModel.Channels.BindingElement> -> System.ServiceModel.Channels.CustomBinding
Public Sub New (bindingElementsInTopDownChannelStackOrder As IEnumerable(Of BindingElement))

Parameter

bindingElementsInTopDownChannelStackOrder
IEnumerable<BindingElement>

Ein IEnumerable<T> Typ BindingElement , der die Bindungselemente des Kanalstapels in top-down-Reihenfolge enthält.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null.

Beispiele

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

// Create a ServiceHost for the CalculatorService type and provide the base address.
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;

SynchronizedCollection<BindingElement> coll = new SynchronizedCollection<BindingElement>();
coll.Add(reliableSession);
coll.Add(httpTransport);

CustomBinding binding = new CustomBinding(coll);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim 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 coll As New SynchronizedCollection(Of BindingElement)()
coll.Add(reliableSession)
coll.Add(httpTransport)

Dim binding As New CustomBinding(coll)

Gilt für:

CustomBinding(Binding)

Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs

Initialisiert eine neue Instanz der CustomBinding Klasse aus den Werten einer angegebenen Bindung.

public:
 CustomBinding(System::ServiceModel::Channels::Binding ^ binding);
public CustomBinding(System.ServiceModel.Channels.Binding binding);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.Binding -> System.ServiceModel.Channels.CustomBinding
Public Sub New (binding As Binding)

Parameter

binding
Binding

Dies Binding wird verwendet, um die benutzerdefinierte Bindung zu initialisieren.

Ausnahmen

binding ist null.

Gilt für:

CustomBinding(BindingElement[])

Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs

Initialisiert eine neue Instanz der CustomBinding Klasse aus einem Array von Bindungselementen.

public:
 CustomBinding(... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parameter

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Der Array Typ BindingElement , der zum Initialisieren der benutzerdefinierten Bindung verwendet wird.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null.

Beispiele

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

// Create a ServiceHost for the CalculatorService type and provide the base address.
 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;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding(elements);
 Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
 Dim 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 elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding(elements)

Gilt für:

CustomBinding(String)

Initialisiert eine neue Instanz der CustomBinding-Klasse.

public:
 CustomBinding(System::String ^ configurationName);
public CustomBinding(string configurationName);
new System.ServiceModel.Channels.CustomBinding : string -> System.ServiceModel.Channels.CustomBinding
Public Sub New (configurationName As String)

Parameter

configurationName
String

Ein Wert des configurationName Attributs, das das binding Element identifiziert, dessen Einstellungen zum Initialisieren der Bindung verwendet werden.

Ausnahmen

Das bindungselement, das durch das Element identifiziert wird, configurationName ist null.

Gilt für:

CustomBinding(String, String, BindingElement[])

Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs
Quelle:
CustomBinding.cs

Initialisiert eine neue Instanz der CustomBinding Klasse aus einem Array von Bindungselementen mit einem angegebenen Namen und Namespace.

public:
 CustomBinding(System::String ^ name, System::String ^ ns, ... cli::array <System::ServiceModel::Channels::BindingElement ^> ^ bindingElementsInTopDownChannelStackOrder);
public CustomBinding(string name, string ns, params System.ServiceModel.Channels.BindingElement[] bindingElementsInTopDownChannelStackOrder);
new System.ServiceModel.Channels.CustomBinding : string * string * System.ServiceModel.Channels.BindingElement[] -> System.ServiceModel.Channels.CustomBinding
Public Sub New (name As String, ns As String, ParamArray bindingElementsInTopDownChannelStackOrder As BindingElement())

Parameter

name
String

Der Name der Bindung.

ns
String

Der Namespace der Bindung.

bindingElementsInTopDownChannelStackOrder
BindingElement[]

Der Array Typ BindingElement , der zum Initialisieren der benutzerdefinierten Bindung verwendet wird.

Ausnahmen

bindingElementsInTopDownChannelStackOrder ist null.

Beispiele

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

// Create a ServiceHost for the CalculatorService type and provide the base address.
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;

BindingElement[] elements = new BindingElement[2];
elements[0] = reliableSession;
elements[1] = httpTransport;

CustomBinding binding = new CustomBinding("MyCustomBinding", "http://localhost/service", elements);
Dim baseAddress As New Uri("http://localhost:8000/servicemodelsamples/service")

' Create a ServiceHost for the CalculatorService type and provide the base address.
Dim 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 elements(1) As BindingElement
elements(0) = reliableSession
elements(1) = httpTransport

Dim binding As New CustomBinding("MyCustomBinding", "http://localhost/service", elements)

Gilt für: