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.