Creates a ServiceHost instance. To register a Security Token Service in IIS create a .svc files in the format that assigns ServiceHost, Factory, and Service parameters.
Namespace: Microsoft.IdentityModel.Protocols.WSTrust
Assembly: Microsoft.IdentityModel (in microsoft.identitymodel.dll)

Usage

Visual Basic
Dim instance As WSTrustServiceHostFactory
Dim constructorString As String
Dim baseAddresses As Uri()
Dim returnValue As ServiceHostBase

returnValue = instance.CreateServiceHost(constructorString, baseAddresses)

Syntax

Visual Basic
Public Overrides Function CreateServiceHost ( _
		constructorString As String, _
		baseAddresses As Uri() _
) As ServiceHostBase
C#
public override ServiceHostBase CreateServiceHost (
		string constructorString,
		Uri[] baseAddresses
)
C++
public:
virtual ServiceHostBase^ CreateServiceHost (
		String^ constructorString, 
		array<Uri^>^ baseAddresses
) override
J#
public ServiceHostBase CreateServiceHost (
		String constructorString, 
		Uri[] baseAddresses
)
JScript
public override function CreateServiceHost (
		constructorString : String, 
		baseAddresses : Uri[]
) : ServiceHostBase

Parameters

constructorString

The STS name that is passed to the Service argument in the .svc file.

baseAddresses

The address under which the .svc file is registered.

Return Value

An instance of Service Host.

Example

The following code snippet shows how to use this class in an .svc file.

  Copy Code
<%@ServiceHost Factory="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory" Service="SimpleActiveSTS.CustomSecurityTokenServiceConfiguration"%>

Exceptions

Exception type Condition
ArgumentNullException

An input argument is null.

InvalidOperationException

The constructorString is not of type SecurityTokenServiceConfiguration.

Remarks

Creates a ServiceHost instance. To register a Security Token Service in IIS create a .svc files in the format that assigns ServiceHost, Factory, and Service parameters.


Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

See Also