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 / March 2005

Tip: Looking for answers? Try searching our database.

The underlying connection was closed: Unable to connect to the rem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve Bugden - 19 Mar 2005 17:09 GMT
Hi,

I am trying to use a web service on an ISPs server and keep getting the
following message:

"The underlying connection was closed: Unable to connect to the remote server"

Fortunately (so I thought), looking on the web
(http://p2p.wrox.com/topic.asp?TOPIC_ID=4858 for example), this seems to be a
known problem and the solution apparently is to add the following code to the
reference.cs

protected override WebRequest GetWebRequest(Uri uri)
       {
           HttpWebRequest webRequest = (HttpWebRequest)
base.GetWebRequest(uri);
           webRequest.KeepAlive = true;
           return webRequest;
       }

I have converted this to vb as follows:

       Protected Overrides Function GetWebRequest(ByVal Uri As Uri) As
WebRequest

           Dim webRequest As HttpWebRequest =
CType(MyBase.GetWebRequest(Uri), HttpWebRequest)

           webRequest.KeepAlive = True
           Return webRequest

       End Function

An import of  system.net is also required.

I put this in the reference.vb file accessible from the web references
section of a  dll which runs on the client.

Unfortunately this doesn’t have any effect and I am wondering what to do now.

Please could someone give me some suggestions.

Steve Bugden.
Steve Bugden - 20 Mar 2005 23:21 GMT
SOme other points that I can now add.

The ISP for the machine that my application is hosted on tells me that my
application is breaking the application pool.

I am now getting an "Service unavailable" message, I have read that IIS can
shut down applications that continually break the App pool.

I have developed the application using visual studio 2002 and therefore it
uses the .net framework 1.0 and the ISP has it running under 1.1. Is this a
likely cause or should the a 1.0 application run under 1.1 OK?

> Hi,
>
[quoted text clipped - 39 lines]
>
> Steve Bugden.

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.