469,271 Members | 1,776 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

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

Yes.
My client has a proxy server. That much i know. In my application I
make two kinds of calls that are affected by the proxy server

I finally got the webservice call working.
But my httpwebrequest.GetReponse() function call throws the above
error.
So here's what i do in the case it works..

//THIS WORKS
myWebService = new DataWebService();
IWebProxy proxyObject = new
WebProxy("ProxyAddress",prefs.BypassOnLocal);
proxyObject.Credentials = CredentialCache.DefaultCredentials;
myWebService.Proxy = proxyObject;
myWebService.WebServiceMethod(); // This works ...!!

//THIS DONT WORK
HttpWebRequest myRequest=
(System.Net.HttpWebRequest)System.Net.WebRequest.C reate(baseUrl);
IWebProxy proxyObject=new
WebProxy(ProxyAddress,prefs.BypassOnLocal);
proxyObject.Credentials = CredentialCache.DefaultCredentials;
myRequest.Proxy = proxyObject;
myRequest.GetResponse(); // fails !!

In the 2nd case, i am trying to read a webpage with XML on it, and
trying to parse it.
This works on all machines, except those that have proxy servers.
Would the manner in which the xml is being returned make a
difference.
We do return the xml as straight text. (performance reasons)

Any ideas?

The erorr of course is
The underlying connection was closed: Unable to connect to the remote
server
Would it make a difference if i did
myREquest.Proxy = WEbProxy.GetDefaultProxy() and then call the
GetResponse function ? Isn't what i am doing pretty much the same
thing ?
Any response is greatly appreciated.

Mar 2 '07 #1
3 9307
>
The erorr of course is
The underlying connection was closed: Unable to connect to the remote
server
Try the following Microsoft Article:

http://support.microsoft.com/default...b;EN-US;915599
Mar 6 '07 #2
On Mar 5, 5:52 pm, "Tigger" <t...@grunt.tvwrote:
The erorr of course is
The underlying connection was closed: Unable to connect to the remote
server

Try the following Microsoft Article:

http://support.microsoft.com/default...b;EN-US;915599
Thanks..i'll give that a shot..

Mar 6 '07 #3
On 6 Mar, 10:07, "nandan" <nand...@gmail.comwrote:
On Mar 5, 5:52 pm, "Tigger" <t...@grunt.tvwrote:
The erorr of course is
The underlying connection was closed: Unable to connect to the remote
server
Try the following Microsoft Article:
http://support.microsoft.com/default...b;EN-US;915599

Thanks..i'll give that a shot..
In case it helps anyone out..
It was a programming error and an obvious one at that.

I was building up the proxy server string like so : proxy.blahblah.com:
80, where the user enters the server and port number, and i
concatenate the string and port number.

Instead of having a single function do this, for all the various times
this has to be done, i had the code duplicated everywhere, and in one
such place, i forgot to concatenate the port number. Which worked
fine, when testing with my test proxy server, because it used the
default port 80(proxy.blahblah.com:80 is the same as
proxy.blahblah.com). But my client was using 8080, so i would get the
underlying connection was closed errror.

Apr 2 '07 #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
3 posts views Thread by MattM | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.