ServiceHostFactory.CreateServiceHost Método

Definición

Crea una interfaz ServiceHost.Creates a ServiceHost.

Sobrecargas

CreateServiceHost(String, Uri[])

Crea un ServiceHost con direcciones base concretas y lo inicializa con datos especificados.Creates a ServiceHost with specific base addresses and initializes it with specified data.

CreateServiceHost(Type, Uri[])

Crea un ServiceHost para un tipo especificado de servicio con una dirección base concreta.Creates a ServiceHost for a specified type of service with a specific base address.

CreateServiceHost(String, Uri[])

Crea un ServiceHost con direcciones base concretas y lo inicializa con datos especificados.Creates a ServiceHost with specific base addresses and initializes it with specified data.

public:
 override System::ServiceModel::ServiceHostBase ^ CreateServiceHost(System::String ^ constructorString, cli::array <Uri ^> ^ baseAddresses);
public override System.ServiceModel.ServiceHostBase CreateServiceHost (string constructorString, Uri[] baseAddresses);
override this.CreateServiceHost : string * Uri[] -> System.ServiceModel.ServiceHostBase
Public Overrides Function CreateServiceHost (constructorString As String, baseAddresses As Uri()) As ServiceHostBase

Parámetros

constructorString
String

Los datos de la inicialización pasados a la instancia ServiceHostBase que el generador está construyendo.The initialization data passed to the ServiceHostBase instance being constructed by the factory.

baseAddresses
Uri[]

Array de tipo Uri que contiene las direcciones base para el servicio hospedado.The Array of type Uri that contains the base addresses for the service hosted.

Devoluciones

Un ServiceHost con direcciones base concretas.A ServiceHost with specific base addresses.

Excepciones

baseAddress es null.baseAddress is null.

No hay ningún contexto de hospedaje proporcionado o constructorString es null o vacío.There is no hosting context provided or constructorString is null or empty.

Ejemplos

En este ejemplo siguiente se muestra cómo utilizar el método CreateServiceHost(String, Uri[]):This example shows how to use the CreateServiceHost(String, Uri[]) method:

public override ServiceHostBase CreateServiceHost
        (string service, Uri[] baseAddresses)

{

    // The service parameter is ignored here because we know our service.
    ServiceHost serviceHost = new ServiceHost(typeof(HelloService),
        baseAddresses);
    return serviceHost;

}
Public Overrides Overloads Function CreateServiceHost(ByVal service As String, ByVal baseAddresses() As Uri) As ServiceHostBase


    ' The service parameter is ignored here because we know our service.
    Dim serviceHost As New ServiceHost(GetType(HelloService), baseAddresses)
    Return serviceHost

End Function

CreateServiceHost(Type, Uri[])

Crea un ServiceHost para un tipo especificado de servicio con una dirección base concreta.Creates a ServiceHost for a specified type of service with a specific base address.

protected:
 virtual System::ServiceModel::ServiceHost ^ CreateServiceHost(Type ^ serviceType, cli::array <Uri ^> ^ baseAddresses);
protected virtual System.ServiceModel.ServiceHost CreateServiceHost (Type serviceType, Uri[] baseAddresses);
override this.CreateServiceHost : Type * Uri[] -> System.ServiceModel.ServiceHost
Protected Overridable Function CreateServiceHost (serviceType As Type, baseAddresses As Uri()) As ServiceHost

Parámetros

serviceType
Type

Especifica el tipo de servicio que se va a hospedar.Specifies the type of service to host.

baseAddresses
Uri[]

Array de tipo Uri que contiene las direcciones base para el servicio hospedado.The Array of type Uri that contains the base addresses for the service hosted.

Devoluciones

Crea un ServiceHost para el tipo de servicio especificado con una dirección base concreta.A ServiceHost for the type of service specified with a specific base address.

Ejemplos

Este ejemplo muestra cómo crear un implementación de invalidación del método CreateServiceHost(Type, Uri[]):This example shows how to create an override implementation of the CreateServiceHost(Type, Uri[]) method:

Se aplica a