WSTrustServiceHostFactory Class

[Starting with the .NET Framework 4.5, Windows Identity Foundation (WIF) has been fully integrated into the .NET Framework. The version of WIF addressed by this topic, WIF 3.5, is deprecated and should only be used when developing against the .NET Framework 3.5 SP1 or the .NET Framework 4. For more information about WIF in the .NET Framework 4.5, also known as WIF 4.5, see the Windows Identity Foundation documentation in the .NET Framework 4.5 Development Guide.]

Factory that provides instances of WSTrustServiceHost in managed hosting environments where the host instance is created dynamically in response to incoming messages.

Namespace: Microsoft.IdentityModel.Protocols.WSTrust
Assembly: Microsoft.IdentityModel (in Microsoft.IdentityModel.dll)

Usage

'Usage
Dim instance As WSTrustServiceHostFactory

Syntax

'Declaration
Public Class WSTrustServiceHostFactory
    Inherits ServiceHostFactory
public class WSTrustServiceHostFactory : ServiceHostFactory
public ref class WSTrustServiceHostFactory : public ServiceHostFactory
public class WSTrustServiceHostFactory extends ServiceHostFactory
public class WSTrustServiceHostFactory extends ServiceHostFactory

Remarks

The WSTrustServiceHostFactory class is the Windows® Identity Foundation (WIF) implementation of the Windows Communication Foundation (WCF) ServiceHostFactory class. This class can be used to deploy WIF security token services (STS) that are hosted in IIS. By default, the WSTrustServiceHostFactory class uses a WSTrustServiceHost service host with a WSTrustServiceContract service contract implementation.

The following code example demonstrates how to use this class in a .svc file.

<% @ServiceHost Language=C# Debug="true" Factory="Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory" Service="MySecurityTokenServiceConfiguration" %>

In the preceding configuration example, the Service attribute is pointing to an implementation of the SecurityTokenServiceConfiguration object that will be used by the framework to determine how the WSTrustServiceHost will be constructed. Configuration settings from a web.config file will be applied towards the construction of the ServiceHost instance. The WSTrustServiceHostFactory class may be overridden to customize this behavior.

Inheritance Hierarchy

System.Object
   System.ServiceModel.Activation.ServiceHostFactoryBase
     System.ServiceModel.Activation.ServiceHostFactory
      Microsoft.IdentityModel.Protocols.WSTrust.WSTrustServiceHostFactory

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

Target Platforms

Windows 7, Windows Server 2008 R2, Windows Vista SP2, Windows Server 2008 SP2, Windows Server 2003 SP2 (32-bit or 64-bit)

Change History

See Also

Reference

WSTrustServiceHostFactory Members
Microsoft.IdentityModel.Protocols.WSTrust Namespace

Copyright © 2008 by Microsoft Corporation. All rights reserved.