Web service calling COM server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ToddT

    Web service calling COM server

    I have some code in a regular client-based app that calls a COM component
    hosted in an EXE. For the code to work, the EXE must be running. This works
    fine.

    When I place the same code in a Web service (using IIS on my local computer)
    and I invoke the COM component, it starts up another instance of the EXE
    rather than use the already running EXE like it does in my client-based app.
    What I need it to do is use the existing running instance of the EXE like in
    the client-based app.

    Note - using GetObject instead of CreatObject had not effect on the
    component instantiation.

    Any help or guidance would be appreciated.
  • Keenan Newton

    #2
    Re: Web service calling COM server

    Well I am assuming CreateObject is kicking off a new COM object and
    creating a new executable, as I would expect it to. So you want to use
    the same EXE, one way to handle this might be to store the COM object
    into applcation state. This way you can call the object whenever you
    like. Are you using Component Services (COM+) as well?

    One side note, I would be cautious about is using a single instance of
    an EXE is the thread safety. What would happen if two calls are made
    at the same time, can the COM object properly handle it?


    Just my 2 cents, Hope this helps

    Comment

    • Keenan Newton

      #3
      Re: Web service calling COM server

      Well I am assuming CreateObject is kicking off a new COM object and
      creating a new executable, as I would expect it to. So you want to use
      the same EXE, one way to handle this might be to store the COM object
      into applcation state. This way you can call the object whenever you
      like. Are you using Component Services (COM+) as well?

      One side note, I would be cautious about is using a single instance of
      an EXE is the thread safety. What would happen if two calls are made
      at the same time, can the COM object properly handle it?


      Just my 2 cents, Hope this helps

      Comment

      Working...