Share via


IIS and COM+ Services

IIS and COM+ Services work together to form a basicarchitecture for building Web applications. Internally, IIS uses the functionality provided by COM+ services to accomplish the following tasks:

  • Isolation of Web Application Processes: Isolate Web applications into distinct processes.
  • Accessing ASP Built-in Objects from COM+ Components: Manage communication between IIS and COM+ components (including the ASP built-in objects and IIS utility components).
  • Accessing COM+ Services from ASP Applications: Manage communication between IIS and COM+ services.
  • Accessing COM+ Transaction Services from ASP Pages: Coordinate transaction processing for transactional ASP pages.

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

Isolation of Web Application Processes

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 or pooled process.

For more information, see Configuring Applications and Configuring Servers for Applications in the IIS product documentation.

Accessing ASP Built-in Objects from COM+ Components

COM+ services use the COM+ ObjectContext object to give COM+ components access to the ASP built-in objects. This only works if you call the COM+ component from an ASP page. For example, if you build a COM+ component in Visual Basic that needs to access a form element from an ASP file, you can use the following code in your COM+ component:

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

For more information, see Accessing ASP Built-In Objects from Components.

Accessing COM+ Services from ASP Applications

IIS uses the COM+ CServiceConfig object to access certain COM+ services without having to internally create a COM+ component. When an ASP application starts, IIS populates the properties of an instance of the CServiceConfig object with application information from the IIS metabase such as what threading model to use, whether to enable side-by-side (SxS) assemblies, COM+ partitioning, or COM+ tracking. Using the CServiceConfig object allows the ASP application to run as if in a COM+ context even though no COM+ components are required.

For more information, see COM+ Servicesand Using COM+ Services .

Accessing COM+ Transaction Services from ASP Pages

When you create a transactional ASP script using the @TRANSACTION directive, COM+ services is notified and a new transaction is started. From that point onwards, COM+ services coordinates the updating of any resources that are under its control. COM+ services guarantees the transaction's integrity by tracking any changes made to persisted resources.

note Note The COM+ ObjectContext object not the same as the ASP built-in object called ObjectContext Object, which is wrapper for the COM+ ObjectContext object. The ASP ObjectContext object makes transaction processing available from an ASP page.Use the @TRANSACTION directive and the ASP built-in object ObectContext object together in an ASP page to process transactions.

For more information, see Understanding Transactions and Using COM+ Services for Processing Transactions.

Related Topics

For further information on isolating and managing applications, see Defining Application Boundaries.