[This is preliminary documentation and subject to change]

## IIS and Component Services

IIS and Component Services work together to form a basic architecture for building Web applications. IIS uses the functionality provided by Component Services to:

- Isolate applications into distinct processes.
- Manage communication between COM+ components (including the ASP built-in objects).
- Coordinate transaction processing for transactional ASP applications.

Note In IIS version 4.0, Microsoft Transaction Server (MTS) provided transaction support. In IIS version 5.0, and later versions, Component Services provides all the transaction support of MTS, in addition to a number of other component development and deployment features.

IIS defines Web applications as a collection of resource files that are grouped into a logical namespace. By grouping resources into applications, you gain the ability to share data throughout the namespace and to run the application in an isolated process.

Internally, IIS coordinates isolated applications through an object known as the Web Application Manager. This object includes a public interface (IWAMAdmin) that you can use to create programs for administering Web applications. When you run a Web application in an isolated process, IIS uses Component Services to coordinate concurrent access to resources and pass context information between COM components.

IIS uses the Component Services ObjectContext object to give COM+ components that are called by ASP access to the ASP built-in objects. For example, if you build a COM+ component in Visual Basic that needs to access a form element from an HTML file, you can use the following code:

    Dim objObjectContext As ObjectContext
    Dim vntIn As Variant
    Set objObjectContext = GetObjectContext ()
    vntIn = objObjectContext.Item("Request").Form("Field1")

Component Services uses the COM+ ObjectContext object to maintain information about a particular instance of a COM+ component. When IIS compiles the ASP script, it calls Component Services to create an ObjectContext for tracking information about the ASP script. The ObjectContext includes an identity property that uniquely identifies instance of the ASP script. For example, if your ASP script creates instances of COM+ components that have been registered with Component Services, each of these objects will be associated with the ASP script's ObjectContext. Similarly, when you create a transactional ASP script with the @TRANSACTION, Component Services is notified and a new transaction is started. From that point onwards, Component Services coordinates the updating of any resources that are under its control. Component Services guarantees the transaction's integrity by tracking any changes made to persisted resources.

The COM+ ObjectContext object not the same as the ASP built-in object called ObjectContext, which is wrapper for the COM+ ObjectContext object. The ASP ObjectContext object makes transaction processing available from ASP script.

Note In IIS version 4.0, transaction support was provided by Microsoft Transaction Server (MTS). For IIS 5.1, and Windows 2000, Component Services provides all the transaction support of MTS, in addition to a number of other features.

Related Topics

- For further information on isolating and managing applications, see Defining Application Boundaries.
- For further information on transaction processing, see Processing Transactions, Understanding Transactions.
- For more information on Component Services and COM+, see the COM+ (Component Services) documentation in the Platform SDK.

© 1997-2001 Microsoft Corporation. All rights reserved.