locked
Problem accessing Request object via COM+ RRS feed

  • Question

  • User-1618293651 posted

    Hi everyone,

    I'm trying to test some Classic ASP apps on 2008 Server Beta (build 6001). Having failed miserably, I've got debug working and created a test app which highlights the problem.

    Basically, I cannot access the Request object via a VB6 COM+ component. Calling GetObjectContext() returns an empty collection. Using the shorthand GetObjectContext("Request") fails outright. The project is referencing the usual Comsvcs.dll and Asp.dll.

    I can access the request object direct from the ASP code though...

    Any ideas? Is it a security issue which is preventing the COM object getting access to the context from IIS? Or is it simply the end of the line for these apps??

    Update: I've now tried this on a Vista box, and I get the same problems, so I think it is an IIS7 issue as opposed to a Win2k8 Beta issue.

    Update 2: This problem is a COM+ / IIS problem - if the component is not registered in COM+ (e.g. just use regsvr32) it works perfectly. Any suggestions appreciated!!

    Chris

    Thursday, September 27, 2007 5:14 AM

Answers

  • User-1618293651 posted

    Problem solved!

    There is a COM+ setting which is required to facilitate your components' access the ASP objects. Look for the 'Allow IIS Intrinsic Properties' check box in the properties of each component :

    • Fire up the COM+ management console
    • Find the COM+ Application in question
    • Find the applicable component in the 'Components' folder
    • Right click on it and choose properties
    • Select the Advanced tab
    • Check the 'Allow IIS Intrinsic Properties' checkbox (...the clue is in the name!)
    • Job done!

    Many thanks to Andreas Klein and his colleagues at MS Support who turned this query around in hours... Fantastic effort, 5 stars!

    ...I'd not even looked in that dialogue box. :0)

    Chris

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, October 8, 2007 11:34 AM

All replies

  • User1347187933 posted

    Did you mean you have VB6 COM component register as COM+ and it failed?

    But which application is calling your VB6 COM?

    Monday, October 1, 2007 2:25 AM
  • User-1618293651 posted

    Hi George - thanks for replying...

    The component registers in COM+ without a problem. The issue is that the behaviour of the code changes before and after being registered with COM+. When the component is in COM+, I cannot access the Request object. When it is not in COM+ it works fine.

    I think this is because when IIS launches the component from COM+, the component is fired up in a seperate process from that in which the IIS engine is running. When the component is just registered in the registry however, the component will be fired up in the same thread as w3wp.

    The component used is typical of a presentation-layer dll which is called from a classic ASP page (ASP code below):

    <%
    Set o = Server.CreateObject("Win2k8Test_PL.CWin2k8Test_PL")
    str = o.ServeTest()
    Set o = Nothing
    Response.Write(str)
    %>

    The component just grabs the Request object and pushes out a querystring value to the page:

    Public Function ServeTest() As String
      Dim oContext As ObjectContext
      Dim oRequest As ASPTypeLibrary.Request
      Dim strHTML As String

      Set oContext = GetObjectContext()
      Set oRequest = oContext("Request")
      ServeTest = oRequest.QueryString.Item("test")
    End Function

    The problem is that the component cannot access the Request object when the component is registered in COM+. It is not a problem if the component is simply registered in the registry.

    I presume because COM+ components execute in a seperate process to IIS, the increased security in Vista / Win2k8 prevents the object being marshalled correctly across the process boundary... I am guessing though!!

    I'm hoping there is an O/S or IIS security setting which will make this work, but I've no idea what it'd be or where I'd find it! Any ideas would be most welcome!

    Chris

    Monday, October 1, 2007 4:27 AM
  • User-47214744 posted

    Is your COM+ component registered in a COM+ application configured as Library or Server? Have you tried setting it as Library?

    Monday, October 1, 2007 2:22 PM
  • User-1618293651 posted

    Hi Carlos,

    I tried that, but unfortunately it still suffers the same problem. It fires up fine as a library app (you can see the component spin up inside the w3wp process in the Component Services console), but I still can't get hold of the Request object from inside the component...

    Do you know of any IIS security settings that might have an impact?

    Chris

    PS) Thanks for the help!

    Tuesday, October 2, 2007 4:47 AM
  • User2012022251 posted

    Chris, 

    Did you ever solve this problem as I've got exactly the same issue and can't find a solution anywhere

    Regards

    Nick

    Wednesday, October 3, 2007 5:12 AM
  • User-1618293651 posted

    Afraid not - still looking.

    We've got a call open with MS at the moment, although I'm not sure whether we'll get any support due to the fact that the code is VB6...

    Still, I'll post back here if I get any new information!

    Chris

    Wednesday, October 3, 2007 5:30 AM
  • User2012022251 posted

    Cheers. Got my fingers crossed as I'm just drawing a blank at the moment and don't relish the idea of having to rewrite the DLL......

    Wednesday, October 3, 2007 9:16 AM
  • User-1618293651 posted

    Problem solved!

    There is a COM+ setting which is required to facilitate your components' access the ASP objects. Look for the 'Allow IIS Intrinsic Properties' check box in the properties of each component :

    • Fire up the COM+ management console
    • Find the COM+ Application in question
    • Find the applicable component in the 'Components' folder
    • Right click on it and choose properties
    • Select the Advanced tab
    • Check the 'Allow IIS Intrinsic Properties' checkbox (...the clue is in the name!)
    • Job done!

    Many thanks to Andreas Klein and his colleagues at MS Support who turned this query around in hours... Fantastic effort, 5 stars!

    ...I'd not even looked in that dialogue box. :0)

    Chris

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, October 8, 2007 11:34 AM
  • User2012022251 posted

    Perfect. Cheers for that

     Nick

    Wednesday, October 10, 2007 7:11 AM