473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

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 9518
>
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

22
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this...
0
by: Luis Esteban Valencia | last post by:
I have an application on my intranet It works fine there when I copied the proyect to the server of the Internet it gives me this error. The arquitecture of my servers are. There is one Server...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
3
by: MattM | last post by:
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...
1
by: Jim | last post by:
I have the following code: Line 35: Dim sURL As String = "http://www.google.com" Line 36: Dim data As Stream = client.OpenRead(Server.UrlPath­Encode(sURL)) Line 37: ...
3
by: Rahul Anand | last post by:
As per our requirements we have a web service which internally connects (Simple HTTP Post Request) to a remote server to initiate some work. We are calling the web service method asynchronously...
3
by: Monty | last post by:
OK, I had an issue with this and found lots of advice that did not apply, so I'm posting what I found hoping it might help someone else. Here's the sitch: you have a COM app that calls to a .Net...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.