473,382 Members | 1,650 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,382 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 9516
>
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.