ServiceHost.AddServiceEndpoint Methode

Definitie

Hiermee voegt u een service-eindpunt toe aan de gehoste service.

Overloads

Name Description
AddServiceEndpoint(Type, Binding, String)

Hiermee voegt u een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding en eindpuntadres.

AddServiceEndpoint(Type, Binding, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding en URI die het eindpuntadres bevat.

AddServiceEndpoint(Type, Binding, String, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding, een eindpuntadres en een URI waarop de service luistert.

AddServiceEndpoint(Type, Binding, Uri, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding, een URI die het eindpuntadres bevat en een URI waarop de service luistert.

AddServiceEndpoint(Type, Binding, String)

Hiermee voegt u een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding en eindpuntadres.

public:
 System::ServiceModel::Description::ServiceEndpoint ^ AddServiceEndpoint(Type ^ implementedContract, System::ServiceModel::Channels::Binding ^ binding, System::String ^ address);
public System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(Type implementedContract, System.ServiceModel.Channels.Binding binding, string address);
override this.AddServiceEndpoint : Type * System.ServiceModel.Channels.Binding * string -> System.ServiceModel.Description.ServiceEndpoint
Public Function AddServiceEndpoint (implementedContract As Type, binding As Binding, address As String) As ServiceEndpoint

Parameters

implementedContract
Type

Het Type contract voor het eindpunt toegevoegd.

binding
Binding

Het Binding voor het eindpunt is toegevoegd.

address
String

Het adres voor het eindpunt is toegevoegd.

Retouren

De ServiceEndpoint toegevoegde aan de gehoste service.

Uitzonderingen

implementedContract address of binding is null.

Voorbeelden

WSHttpBinding binding = new WSHttpBinding();
serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, "http://localhost:8000/servicemodelsamples/service/basic");
Dim binding As BasicHttpBinding = New BasicHttpBinding()
serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, "http://localhost:8000/servicemodelsamples/service/basic")

Van toepassing op

AddServiceEndpoint(Type, Binding, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding en URI die het eindpuntadres bevat.

public:
 System::ServiceModel::Description::ServiceEndpoint ^ AddServiceEndpoint(Type ^ implementedContract, System::ServiceModel::Channels::Binding ^ binding, Uri ^ address);
public System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(Type implementedContract, System.ServiceModel.Channels.Binding binding, Uri address);
override this.AddServiceEndpoint : Type * System.ServiceModel.Channels.Binding * Uri -> System.ServiceModel.Description.ServiceEndpoint
Public Function AddServiceEndpoint (implementedContract As Type, binding As Binding, address As Uri) As ServiceEndpoint

Parameters

implementedContract
Type

Het Type contract voor het eindpunt toegevoegd.

binding
Binding

Het Binding voor het eindpunt is toegevoegd.

address
Uri

Het Uri adres dat het adres voor het eindpunt bevat dat is toegevoegd.

Retouren

De ServiceEndpoint toegevoegde aan de gehoste service.

Uitzonderingen

implementedContract address of binding is null.

Voorbeelden

BasicHttpBinding binding = new BasicHttpBinding();
Uri address = new Uri("http://localhost:8000/servicemodelsamples/service/basic");
serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, address);
Dim binding As BasicHttpBinding = New BasicHttpBinding()
Dim address As Uri = New Uri("http://localhost:8000/servicemodelsamples/service/basic")
serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, address)

Van toepassing op

AddServiceEndpoint(Type, Binding, String, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding, een eindpuntadres en een URI waarop de service luistert.

public:
 System::ServiceModel::Description::ServiceEndpoint ^ AddServiceEndpoint(Type ^ implementedContract, System::ServiceModel::Channels::Binding ^ binding, System::String ^ address, Uri ^ listenUri);
public System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(Type implementedContract, System.ServiceModel.Channels.Binding binding, string address, Uri listenUri);
override this.AddServiceEndpoint : Type * System.ServiceModel.Channels.Binding * string * Uri -> System.ServiceModel.Description.ServiceEndpoint
Public Function AddServiceEndpoint (implementedContract As Type, binding As Binding, address As String, listenUri As Uri) As ServiceEndpoint

Parameters

implementedContract
Type

Het Type contract voor het eindpunt toegevoegd.

binding
Binding

Het Binding voor het eindpunt is toegevoegd.

address
String

Het eindpuntadres voor de service.

listenUri
Uri

De Uri service-eindpunten waarop de service-eindpunten kunnen luisteren.

Retouren

De ServiceEndpoint toegevoegde aan de gehoste service.

Uitzonderingen

implementedContract address of binding is null.

Voorbeelden

BasicHttpBinding binding = new BasicHttpBinding();
Uri listenUri = new Uri("http://localhost:8000/MyListenUri");
string address = "http://localhost:8000/servicemodelsamples/service2";
serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, address, listenUri);
Dim binding As BasicHttpBinding = New BasicHttpBinding()
Dim listenUri As Uri = New Uri("http://localhost:8000/MyListenUri")
Dim address As String = "http://localhost:8000/servicemodelsamples/service/basic"
serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, address, listenUri)

Opmerkingen

Gebruik deze versie van de methode wanneer u meerdere eindpunten hebt die op dezelfde opgegeven URI moeten luisteren.

Van toepassing op

AddServiceEndpoint(Type, Binding, Uri, Uri)

Voegt een service-eindpunt toe aan de gehoste service met een opgegeven contract, binding, een URI die het eindpuntadres bevat en een URI waarop de service luistert.

public:
 System::ServiceModel::Description::ServiceEndpoint ^ AddServiceEndpoint(Type ^ implementedContract, System::ServiceModel::Channels::Binding ^ binding, Uri ^ address, Uri ^ listenUri);
public System.ServiceModel.Description.ServiceEndpoint AddServiceEndpoint(Type implementedContract, System.ServiceModel.Channels.Binding binding, Uri address, Uri listenUri);
override this.AddServiceEndpoint : Type * System.ServiceModel.Channels.Binding * Uri * Uri -> System.ServiceModel.Description.ServiceEndpoint
Public Function AddServiceEndpoint (implementedContract As Type, binding As Binding, address As Uri, listenUri As Uri) As ServiceEndpoint

Parameters

implementedContract
Type

Het Type contract voor het eindpunt toegevoegd.

binding
Binding

Het Binding voor het eindpunt is toegevoegd.

address
Uri

Het Uri adres dat het adres voor het eindpunt bevat dat is toegevoegd.

listenUri
Uri

De Uri service-eindpunten waarop de service-eindpunten kunnen luisteren.

Retouren

De ServiceEndpoint toegevoegde aan de gehoste service.

Uitzonderingen

implementedContract address of binding is null.

De contracten worden niet geïnitialiseerd of de contractsleutels kunnen niet worden gevonden.

Voorbeelden

BasicHttpBinding binding = new BasicHttpBinding();
Uri listenUri = new Uri("http://localhost:8000/MyListenUri");
Uri address = new Uri("http://localhost:8000/servicemodelsamples/service3");
serviceHost.AddServiceEndpoint(typeof(ICalculator), binding, address, listenUri);
Dim binding As BasicHttpBinding = New BasicHttpBinding()
Dim listenUri As Uri = New Uri("http://localhost:8000/MyListenUri")
Dim address As Uri = New Uri("http://localhost:8000/servicemodelsamples/service/basic")
serviceHost.AddServiceEndpoint(GetType(ICalculator), binding, address, listenUri)

Opmerkingen

Gebruik deze versie van de methode wanneer u meerdere eindpunten hebt die op dezelfde opgegeven URI moeten luisteren.

Van toepassing op