Editar

Compartir a través de


WebServiceHost Constructors

Definition

Initializes a new instance of the WebServiceHost class.

Overloads

WebServiceHost()

Initializes a new instance of the WebServiceHost class.

WebServiceHost(Object, Uri[])

Initializes a new instance of the WebServiceHost class with the specified singleton server instance and base address.

WebServiceHost(Type, Uri[])

Initializes a new instance of the WebServiceHost class with the specified service type and base address.

WebServiceHost()

Initializes a new instance of the WebServiceHost class.

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

Applies to

WebServiceHost(Object, Uri[])

Initializes a new instance of the WebServiceHost class with the specified singleton server instance and base address.

public:
 WebServiceHost(System::Object ^ singletonInstance, ... cli::array <Uri ^> ^ baseAddresses);
public WebServiceHost (object singletonInstance, params Uri[] baseAddresses);
new System.ServiceModel.Web.WebServiceHost : obj * Uri[] -> System.ServiceModel.Web.WebServiceHost
Public Sub New (singletonInstance As Object, ParamArray baseAddresses As Uri())

Parameters

singletonInstance
Object

A service instance to be used as the singleton instance.

baseAddresses
Uri[]

The base address of the service.

Examples

The following example shows how to call this constructor.

Uri[] baseAddresses = { new Uri("http://localhost/one"), new Uri("http://localhost/two") };
object mySingleton = GetObject();
WebServiceHost host = new WebServiceHost(mySingleton, baseAddresses);
Dim baseAddresses() As Uri = {New Uri("http://localhost/one"), New Uri("http://localhost/two")}
Dim mySingleton As Object = GetObject()
Dim host As WebServiceHost = New WebServiceHost(mySingleton, baseAddresses)

Remarks

The baseAddresses parameter can consist of one or more base addresses.

Applies to

WebServiceHost(Type, Uri[])

Initializes a new instance of the WebServiceHost class with the specified service type and base address.

public:
 WebServiceHost(Type ^ serviceType, ... cli::array <Uri ^> ^ baseAddresses);
public WebServiceHost (Type serviceType, params Uri[] baseAddresses);
new System.ServiceModel.Web.WebServiceHost : Type * Uri[] -> System.ServiceModel.Web.WebServiceHost
Public Sub New (serviceType As Type, ParamArray baseAddresses As Uri())

Parameters

serviceType
Type

The service type.

baseAddresses
Uri[]

The base address of the service.

Examples

The following example shows how to call this constructor.

Uri[] baseAddresses = { new Uri("http://localhost/one"), new Uri("http://localhost/two") };
WebServiceHost host = new WebServiceHost(typeof(CalcService), baseAddresses);
Dim baseAddresses() As Uri = {New Uri("http://localhost/one"), New Uri("http://localhost/two")}
Dim host As WebServiceHost = New WebServiceHost(GetType(CalcService), baseAddresses)

Remarks

The baseAddresses parameter can consist of one or more base addresses.

Applies to