By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,246 Members | 1,480 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,246 IT Pros & Developers. It's quick & easy.

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

P: n/a
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"
Sep 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Monty" <mo***@community.nospamwrote in message
news:uv**************@TK2MSFTNGP04.phx.gbl...
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
Sep 27 '06 #2

P: n/a
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"
Sep 28 '06 #3

P: n/a
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" <ag******@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
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.
Sep 28 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.