Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / April 2007

Tip: Looking for answers? Try searching our database.

Call to external webservice returns error "System.Net.WebException: The underlying connection was closed: Unable to connect to the remote server."

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rossco - 31 Mar 2005 07:56 GMT
I have a VB.NET serviced component (COM+), running on a lan, that
calls out to an external web service to place an order with a
supplier.

The problem machine is the middle tier (COM+) for our in house
applications, and also has a mail server to service a 100 stores
(don't ask me why, I don't like this either).

The call to the webservice works correctly on our test COM+ machine
but fails on the production machine with the above error.  It also
works correctly from my development machine.

I have no control over the implementation of the webservice.

From the problem machine, I can access the asmx via internet explorer
and see web methods and descriptions.

The machine.config is in its default state (no proxy specified).

The network admin has given both COM+ machines (and my developer
machine if I run it from here) the ability to bypass the proxy server,
thus there are no settings specified (or required to browse the web)
in the IE LAN settings.  I did this as I couldn't get it to work by
supplying credentials programmatically ( eg svr.PreAuthenticate =
true; and svr.Proxy.Credentials = new
System.Net.NetworkCredential("username","password","domain");).

I have run netstat -p TCP on the production COM+ machine.  On that
occassion there were probably 20 connections in the TIME_WAIT state
and probably 40 ESTABLISHED.

I am about to rebuild the serviced component to return the stack trace
rather than exception.tostring.  Hopefully that might reveal more
detail.

Any help is appreciated.

Regards,

Ross
rnojspamempson@gmail.com - 31 Mar 2005 08:06 GMT
PS.

It is framework v 1.1 SP1, and WSE 1.0
rnojspamempson@gmail.com - 02 Apr 2005 03:50 GMT
This was fixed by clearing an old (no longer existing switch or server)
registry setting for the default gateway from a previous version of IE.
I searched the registry for proxy settings and found this one, deleted
it, and had to restart, refresh components in COM+ to get it to work.

Essentially in this case I am not supplying the proxy address /
credentials programmatically,  and the machine this is installed on has
to be able to bypass the proxy server to access the internet.  Using
the default gateway.  I guess it must first look for any IE proxy
settings, and tries to use them.  I dont fully understand but it might
also depend on the user context under which the application is running.
In this case I have COM+ impersonating a network user, and this might
cause the web classes to look for a profile (roaming profiles) on the
COM+ machine when it goes to look for IE settings?

I am interested to understand how this works.
usasajith - 09 Apr 2007 13:58 GMT
try this on machine.config.

<defaultProxy>
<proxy usesystemdefault="false" proxyaddress="http:proxyserver:8080"
bypassonlocal="true" />
</defaultProxy>

replace proxyserver:8080 with proxyserver name and port number

it worked for me. hooray.

Signature

Ajith Kumar Shetty
Software Engineer
Aditi Technologies
Bangalore


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.