ServiceHost.AddServiceEndpoint Método

Definición

Añade un extremo de servicio al servicio hospedado.

Sobrecargas

AddServiceEndpoint(Type, Binding, String)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y una dirección del punto de conexión.

AddServiceEndpoint(Type, Binding, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y un URI que contiene la dirección del punto de conexión.

AddServiceEndpoint(Type, Binding, String, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y una dirección del punto de conexión y un URI en el que escucha el servicio.

AddServiceEndpoint(Type, Binding, Uri, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace, un URI que contiene la dirección del punto de conexión y uno en el que se escucha el servicio.

AddServiceEndpoint(Type, Binding, String)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y una dirección del punto de conexión.

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

Parámetros

implementedContract
Type

El Type de contrato para el extremo agregado.

binding
Binding

Binding para el extremo agregado.

address
String

Dirección del punto de conexión agregado.

Devoluciones

ServiceEndpoint

ServiceEndpoint agregado al servicio hospedado.

Excepciones

implementedContract o binding o address es null.

Ejemplos

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")

Se aplica a

AddServiceEndpoint(Type, Binding, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y un URI que contiene la dirección del punto de conexión.

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

Parámetros

implementedContract
Type

El Type de contrato para el extremo agregado.

binding
Binding

Binding para el extremo agregado.

address
Uri

Uri que contiene la dirección del extremo agregado.

Devoluciones

ServiceEndpoint

ServiceEndpoint agregado al servicio hospedado.

Excepciones

implementedContract o binding o address es null.

Ejemplos

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)

Se aplica a

AddServiceEndpoint(Type, Binding, String, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace y una dirección del punto de conexión y un URI en el que escucha el servicio.

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

Parámetros

implementedContract
Type

El Type de contrato para el extremo agregado.

binding
Binding

Binding para el extremo agregado.

address
String

Dirección del punto de conexión del servicio.

listenUri
Uri

Uri en el que los extremos de servicio pueden realizar escuchas.

Devoluciones

ServiceEndpoint

ServiceEndpoint agregado al servicio hospedado.

Excepciones

implementedContract o binding o address es null.

Ejemplos

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)

Comentarios

Utilice esta versión del método cuando tiene varios extremos que necesitan realizar escuchas en el mismo URI especificado.

Se aplica a

AddServiceEndpoint(Type, Binding, Uri, Uri)

Agrega un punto de conexión de servicio al servicio hospedado con un contrato especificado, un enlace, un URI que contiene la dirección del punto de conexión y uno en el que se escucha el servicio.

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

Parámetros

implementedContract
Type

El Type de contrato para el extremo agregado.

binding
Binding

Binding para el extremo agregado.

address
Uri

Uri que contiene la dirección del extremo agregado.

listenUri
Uri

Uri en el que los extremos de servicio pueden realizar escuchas.

Devoluciones

ServiceEndpoint

ServiceEndpoint agregado al servicio hospedado.

Excepciones

implementedContract o binding o address es null.

No se inicializan los contratos o no se pueden encontrar las claves de contrato.

Ejemplos

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)

Comentarios

Utilice esta versión del método cuando tiene varios extremos que necesitan realizar escuchas en el mismo URI especificado.

Se aplica a