underlying connection was closed: unable to connect to the remote server: COM --> .Net --> WebServic

Discussion in 'ASP .Net' started by Monty, Sep 27, 2006.

  1. Monty

    Monty Guest

    OK, I had an issue with this and found lots of advice that did not apply, so
    I'm posting what I found hoping it might help someone else. Here's the
    sitch: you have a COM app that calls to a .Net assembly which in turn calls
    a web service. You know the web service is reachable and that the COM app is
    able to instantiate your .Net assembly (because you RegAsm'ed it and it's
    good to go). However, when you attempt to make a call to the web service you
    get the error message "underlying connection was closed: unable to connect
    to the remote server". Chances are, you've had people telling you this is a
    proxy issue even though you're pretty sure it's not. OK, here's what saved
    me: simply add your assembly to the GAC. That's it. Even if you've RegAsm'ed
    the heck outta your assembly and the COM object has no problems
    instantiating it, I got this error every time it made a call to the
    webservice until I added it to the GAC, then it worked like magic.

    If anyone knows why this is, please chime in. Thanks.

    Keywords: COM, ASMX, Web Service, Web Services, interop, REGASM, GACUTIL,
    CCW, Register for COM, proxy, proxies, "underlying connection was closed:
    unable to connect to the remote server"
     
    Monty, Sep 27, 2006
    #1
    1. Advertising

  2. "Monty" <> wrote in message
    news:...
    > OK, I had an issue with this and found lots of advice that did not apply,
    > so I'm posting what I found hoping it might help someone else. Here's the
    > sitch: you have a COM app that calls to a .Net assembly which in turn
    > calls a web service. You know the web service is reachable and that the
    > COM app is able to instantiate your .Net assembly (because you RegAsm'ed
    > it and it's good to go). However, when you attempt to make a call to the
    > web service you get the error message "underlying connection was closed:
    > unable to connect to the remote server". Chances are, you've had people
    > telling you this is a proxy issue even though you're pretty sure it's not.
    > OK, here's what saved me: simply add your assembly to the GAC. That's it.
    > Even if you've RegAsm'ed the heck outta your assembly and the COM object
    > has no problems instantiating it, I got this error every time it made a
    > call to the webservice until I added it to the GAC, then it worked like
    > magic.
    >
    > If anyone knows why this is, please chime in. Thanks.


    I wonder if this is a trust issue.

    John
     
    John Saunders, Sep 27, 2006
    #2
    1. Advertising

  3. Monty

    David Betz Guest

    I'm surprised you aren't getting threading errors... COM's not supposed
    to do stuff like that.

    Try switching everything to COM+ (Enterprise Services)... that ALWAYS
    works for me. I just many applications via Enterprise Services.

    Monty wrote:
    > OK, I had an issue with this and found lots of advice that did not apply, so
    > I'm posting what I found hoping it might help someone else. Here's the
    > sitch: you have a COM app that calls to a .Net assembly which in turn calls
    > a web service. You know the web service is reachable and that the COM app is
    > able to instantiate your .Net assembly (because you RegAsm'ed it and it's
    > good to go). However, when you attempt to make a call to the web service you
    > get the error message "underlying connection was closed: unable to connect
    > to the remote server". Chances are, you've had people telling you this is a
    > proxy issue even though you're pretty sure it's not. OK, here's what saved
    > me: simply add your assembly to the GAC. That's it. Even if you've RegAsm'ed
    > the heck outta your assembly and the COM object has no problems
    > instantiating it, I got this error every time it made a call to the
    > webservice until I added it to the GAC, then it worked like magic.
    >
    > If anyone knows why this is, please chime in. Thanks.
    >
    > Keywords: COM, ASMX, Web Service, Web Services, interop, REGASM, GACUTIL,
    > CCW, Register for COM, proxy, proxies, "underlying connection was closed:
    > unable to connect to the remote server"
     
    David Betz, Sep 28, 2006
    #3
  4. Monty

    Monty Guest

    Hi David,

    It seems to be working fine now that it's in the GAC. What exactly is COM
    not supposed to do? Can you point me towards any docs on this?
    Thanks


    "David Betz" <> wrote in message
    news:...
    > I'm surprised you aren't getting threading errors... COM's not supposed
    > to do stuff like that.
    >
    > Try switching everything to COM+ (Enterprise Services)... that ALWAYS
    > works for me. I just many applications via Enterprise Services.
    >
     
    Monty, Sep 29, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marisha
    Replies:
    0
    Views:
    1,235
    Marisha
    Mar 27, 2006
  2. Ilya
    Replies:
    0
    Views:
    144
  3. Tom McDonald
    Replies:
    1
    Views:
    185
    Tom McDonald
    Dec 20, 2003
  4. David Jeff
    Replies:
    1
    Views:
    286
    Jan Tielens
    Jan 2, 2004
  5. Frasse
    Replies:
    3
    Views:
    281
    Jan Tielens
    Feb 13, 2004
Loading...

Share This Page