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.
Пространство имен: Microsoft.IdentityModel.Protocols.WSTrust
Сборка: Microsoft.IdentityModel (в microsoft.identitymodel.dll)

Использование

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

returnValue = instance.CreateServiceHost(constructorString, baseAddresses)

Синтаксис

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

Параметры

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.

Возвращаемое значение

An instance of Service Host.

Пример

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

  Копировать код
<%@ServiceHost Factory="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory" Service="SimpleActiveSTS.CustomSecurityTokenServiceConfiguration"%>

Исключения

Тип исключений Условие
ArgumentNullException

An input argument is null.

InvalidOperationException

The constructorString is not of type SecurityTokenServiceConfiguration.

Примечания

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.


Безопасность потоков

Любые открытые статические члены (Shared в Visual Basic) этого типа являются поточно-ориентированными.Любые члены экземпляров не являются гарантированно поточно-ориентированными.

Платформы

Платформа разработки

Windows Server 2003, Windows Vista

Target Platforms

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

Change History

См. также