472,139 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,139 software developers and data experts.

The underlying connection was closed

I am getting the "The underlying connection was closed: Unable to connect to
the remote server" message when trying to connect an ASPX page to a simple
Hello World web service. I have read a few posts on this topic but my
situation is different. The problem appears to be a setting with my test
server. The basic scenario is it works when the URL is the short server name
(testserver) but fails with the full server name (testserver.abc.com).

Here's a summary of what works and what doesn't:

These Situations Work
* ASPX and Web Service on localhost
* ASPX on localhost / Web Service on test server
* ASPX and Web Service on test server / use short URL (testserver)

This fails with the error message
* ASPX and Web Service on test server / use full URL (testserver.abc.com)

What I can't figure out is what is causing the failure. If I use the FQDN
(ex. testserver.abc.com) the error message happens. If I replace the URL with
the machine name (ex. testserver) then it works fine.

Since this only happens when both the web page and the web service are on
the machine I don't think it's a proxy issue. Everything I read about this
message says it's a proxy issue so I'm lost as to what to research.

Can anyone think of what it may be? I'd at least like to know what to
investigate.

Nov 21 '05 #1
3 3143
Hard code the IP for the URL in the HOSTS file. That might cure the issue.
Also ensure you are using the web service reference correctly, especially if
you wired it yourself.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"MattM" wrote:
I am getting the "The underlying connection was closed: Unable to connect to
the remote server" message when trying to connect an ASPX page to a simple
Hello World web service. I have read a few posts on this topic but my
situation is different. The problem appears to be a setting with my test
server. The basic scenario is it works when the URL is the short server name
(testserver) but fails with the full server name (testserver.abc.com).

Here's a summary of what works and what doesn't:

These Situations Work
* ASPX and Web Service on localhost
* ASPX on localhost / Web Service on test server
* ASPX and Web Service on test server / use short URL (testserver)

This fails with the error message
* ASPX and Web Service on test server / use full URL (testserver.abc.com)

What I can't figure out is what is causing the failure. If I use the FQDN
(ex. testserver.abc.com) the error message happens. If I replace the URL with
the machine name (ex. testserver) then it works fine.

Since this only happens when both the web page and the web service are on
the machine I don't think it's a proxy issue. Everything I read about this
message says it's a proxy issue so I'm lost as to what to research.

Can anyone think of what it may be? I'd at least like to know what to
investigate.

Nov 21 '05 #2
I don't think this is related to the HOSTS file as I have no problem refering
to the server using the full name (testserver.abc.com). It's only the web
service that has this problem.

One thing to note is that my machine is Win2k and the test server is Win2003.
"Cowboy (Gregory A. Beamer) - MVP" wrote:
Hard code the IP for the URL in the HOSTS file. That might cure the issue.
Also ensure you are using the web service reference correctly, especially if
you wired it yourself.
---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************

"MattM" wrote:
I am getting the "The underlying connection was closed: Unable to connect to
the remote server" message when trying to connect an ASPX page to a simple
Hello World web service. I have read a few posts on this topic but my
situation is different. The problem appears to be a setting with my test
server. The basic scenario is it works when the URL is the short server name
(testserver) but fails with the full server name (testserver.abc.com).

Here's a summary of what works and what doesn't:

These Situations Work
* ASPX and Web Service on localhost
* ASPX on localhost / Web Service on test server
* ASPX and Web Service on test server / use short URL (testserver)

This fails with the error message
* ASPX and Web Service on test server / use full URL (testserver.abc.com)

What I can't figure out is what is causing the failure. If I use the FQDN
(ex. testserver.abc.com) the error message happens. If I replace the URL with
the machine name (ex. testserver) then it works fine.

Since this only happens when both the web page and the web service are on
the machine I don't think it's a proxy issue. Everything I read about this
message says it's a proxy issue so I'm lost as to what to research.

Can anyone think of what it may be? I'd at least like to know what to
investigate.

Nov 21 '05 #3
I think I have an insight here. You say it works when you use the short
name (e.g. local LAN name) for the server. But it fails when you use the
full qualified internet name for the server. In many cases, machines
inside of firewalls are not addressable thru the company's public firewall
- which is where the resolution will take you when you use the full name.
If this is the case, the company's firewall is closing the connection.

Is your test machine addressable from the public internet (e.g. if I went
to my public library and typed in a URL that you gave me for a page on your
test machine, would I get a page, or would your company's firewall prevent
me from hitting that server?

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: The underlying connection was closed
thread-index: AcS8LfgXnDHMQ9sLQKCR2MeE+g6icw==
X-WBNR-Posting-Host: 192.85.47.1
From: "=?Utf-8?B?TWF0dE0=?=" <Ma***@discussions.microsoft.com>
Subject: The underlying connection was closed
Date: Wed, 27 Oct 2004 07:05:09 -0700
Lines: 28
Message-ID: <2E**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7150
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

I am getting the "The underlying connection was closed: Unable to connect
to
the remote server" message when trying to connect an ASPX page to a simple
Hello World web service. I have read a few posts on this topic but my
situation is different. The problem appears to be a setting with my test
server. The basic scenario is it works when the URL is the short server
name
(testserver) but fails with the full server name (testserver.abc.com).

Here's a summary of what works and what doesn't:

These Situations Work
* ASPX and Web Service on localhost
* ASPX on localhost / Web Service on test server
* ASPX and Web Service on test server / use short URL (testserver)

This fails with the error message
* ASPX and Web Service on test server / use full URL
(testserver.abc.com)

What I can't figure out is what is causing the failure. If I use the FQDN
(ex. testserver.abc.com) the error message happens. If I replace the URL
with
the machine name (ex. testserver) then it works fine.

Since this only happens when both the web page and the web service are on
the machine I don't think it's a proxy issue. Everything I read about this
message says it's a proxy issue so I'm lost as to what to research.

Can anyone think of what it may be? I'd at least like to know what to
investigate.
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

26 posts views Thread by Rajeev Tipnis | last post: by
2 posts views Thread by =?Utf-8?B?RnJpZWRoZWxtRWljaGlu?= | last post: by
4 posts views Thread by =?Utf-8?B?QXJuYXVkIFZpc2N1c2k=?= | last post: by

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.