Platform SDK: Transaction Server |
[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]
This topic covers the following:
For more information on the methods for creating MTS objects, see Creating MTS Objects.
Calling MTS Components from a Client Application
MTS components can be located on a separate computer from the client. A client can call a remote MTS component using DCOM, HTTP, or Remote Automation. To run an MTS component on the client computer, the client computer must have MTS installed.
DCOM is the standard transport for calling MTS components. To enable DCOM calls to MTS components, you must configure the following:
Client Registry Settings — The easiest way to configure your client application to call a remote MTS component is to use the application executable utility, which automatically configures client registry settings. For more information, see the Administrator's Guide.
DCOM Security Settings — You may have to configure the Impersonation Level and Authentication Level on both client and server computers. MTS works properly using the default values for these settings: Identify for Impersonation Level and Connect for Authentication Level. Make the necessary changes in the MTS Explorer at the package level. Changing default settings by using the DCOM configuration utility (dcomcnfg.exe) is not recommended.
Windows 98 includes DCOM support. However, if you want to use Microsoft Windows 95 clients with MTS, install DCOM for Windows® 95. For the latest information on DCOM support for Windows 95, see http://www.microsoft.com/resources/downloads.asp on the World Wide Web.
Remote Automation was introduced with Visual Basic® version 4.0, before the introduction of DCOM. It is useful for 16-bit clients, because DCOM works only in 32-bit environments. To use Remote Automation with MTS, the Remote Automation Manager (RACMAN) must be running on the server where the MTS components are installed. For more information, see the Visual Basic documentation.
Note You cannot use MTS security Remote Automation since all calls are made using the RACMAN identity. Because RACMAN does not impersonate when calling the components on the server, the client identity cannot be determined.
There are two ways a client can call an MTS component through HTTP:
Calling MTS Components from an Active Server Page
You can call MTS components from Active Server Pages (ASPs). You can create an MTS object from an ASP by calling Server.CreateObject. Note that if the MTS component has implemented the OnStartPage and OnEndPage methods, the OnStartPage method is called at this time.
You can run your MTS components in-process with or out-of-process with Internet Information Server (IIS). If you run your MTS components in-process with IIS, be aware that if MTS encounters an unexpected internal error condition or an unhandled application error such as a general-protection fault inside a component method call, it immediately results in a failfast, thus terminating the process and IIS.
By default, IIS 3.0 disables calling out-of-process components. To enable calling out-of-process components, modify the following registry entry
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\ASP\Parameters
by setting the AllowOutOfProcCmpnts key to 1.
Calling MTS Components from a Web Browser-Resident Component
You can call an MTS component from a Web browser – resident component. Use the application executable utility to configure that client, and then use the HTML <OBJECT> tag to call that component. You can also use the <OBJECT> tag to create an MTS object in-process with the browser client. Remember that MTS must be installed on the client computer for an MTS component to run in-process.
The component should be made safe for scripting, either through a component category entry in the registry, or by supporting the IObjectSafety interface.
Remote Data Service (RDS) also allows you to create web browser – resident components using the <OBJECT> tag. RDS supports the following:
Except for in-process objects, the CreateObject method of the DataSpace object creates a proxy for the MTS object that runs in a local or remote server process.
You must configure the following registry key to the Prog ID of the object that you want to call:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ADCLaunch