473,473 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

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
3 2083
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Rajiv | last post by:
Hello, I developed a No touch deployment client which accesses data through a web service. The application worked really well until I installed .NET framework 1.1 SP1. It worked well without the...
0
by: Matthew B. Lehrman | last post by:
I've googled all over the place trying to get answer to this question and some things have come close, but nothing quite. Asp.NET 1.1, Visual Studio 2003 I am writing Visual Basic apps. I can...
0
by: Apu Nahasapeemapetilon | last post by:
Why do I get the following two error messages, intermittently, when I issue a "SendRequestResponse(methodName, requestEnvelope);" command on a class derived from...
1
by: MSK | last post by:
Hi, I am a newbie to .NET/Networking if I develop a project in 1. VB.NET + SQL server database 2. ASP.NET + SQL server database 3. .NET ( vb or asp) + Access database
2
by: =?Utf-8?B?RnJpZWRoZWxtRWljaGlu?= | last post by:
I am consuming continously my own web-services on a localhost client with a rate of perhaps 35 request/response-pairs a minute. I am using "invoke-id=1", so there is at the same time only one...
0
sivisr
by: sivisr | last post by:
Hi I want to connect my vb.net Windows application (C#) with remote server, i use the follwing coding.it says "SQL Server does not exist or access denide" . SqlConnection con = new...
4
by: =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= | last post by:
Hi all, we meet a problem since we use WCF to consume java WebServices. Often the first call works then the second raises the following error : "The underlying connection was closed : " We...
0
by: imonline | last post by:
Hi, I have created a asp.net page which posts XML on the web service using .net 2.0. The page and the webservice was working fine but once I converted them to .net 3.5 I have been getting...
4
by: Sin Jeong-hun | last post by:
I don't get the message so it's hard to debug that, but some of my clients report that they get "The underlying connection was closed unexpectedly" exception. According to this site (http://...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.