Microsoft KB Archive/193230

= PRB: Server.CreateObject Fails When Object Is Behind Firewall =

Article ID: 193230

Article Last Modified on 5/3/2006

-

APPLIES TO


 * Microsoft Active Server Pages 4.0
 * Microsoft Internet Information Server 4.0

-



This article was previously published under Q193230



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SYMPTOMS
In Active Server Pages, when instantiating a COM object on a remote computer that is located behind a firewall, the following error occurs:

Server object error 'ASP 0177 : 800706be'

Server.CreateObject Failed

/file.asp, line #

The remote procedure call failed.

The following log entry may be present in the Application Event Log of the IIS server:

MTS Event 4134

Failed on creation from object context: CreateInstance

(ProgId: )

(CLSID: {})

(Interface: IUnknown)

(IID: {00000000-0000-0000-C000-000000000046})

(Microsoft Transaction Server Internals Information: File:

d:\viper\src\runtime\context\ccontext.cpp, Line: 1228)

The following log entry may be present in the Application Event Log of the computer on which the object was configured to be launched:

Event 4097

The run-time environment has detected an inconsistency in its internal

state and has terminated the process. Please contact Microsoft Product

Support Services to report this error. Internal Check Failure on

condition: hr == S_OK

(Package: )

(Microsoft Transaction Server Internals Information: File:

d:\viper\src\runtime\context\cuserprops.cpp, Line: 1047)



CAUSE
The Server.CreateObject method attempts to marshal the ASP intrinsic objects (Request, Response, and so forth) to Microsoft Transaction Server (MTS). When the MTS server is behind a firewall, MTS is unable to unmarshal these intrinsic objects because Interface Callbacks are not possible across DCOM Firewalls. Thus, the creation of the object fails.



RESOLUTION
The CreateObject function in VBScript does not use MTS, and the ASP intrinsic objects are not marshaled, so the creation of the COM object works fine across the firewall.

The drawbacks of using the VBScript CreateObject function instead of the ASP Server.CreateObject method, is that the ASP page will not be a part of the same MTS transaction as the component, the component behind the firewall cannot use any of the ASP intrinsic objects, nor can the component obtain any security information about the page.

The component can still participate in a MTS transaction, but no information concerning the failure or success of the transaction is passed back to the ASP page due to the page being in a different transaction.



STATUS
This behavior is by design.



MORE INFORMATION
Here's an example of Server.CreateObject syntax:

Dim objMyObject Set objMyObject = Server.CreateObject("MyProgID.MyProgID")

Here's an example of CreateObject syntax:

Dim objMyObject Set objMyObject = CreateObject("MyProgID.MyProgID")

