+ Start a Discussion

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

Hi All,
I downloaded the sample code for C#.Net applications. I had downloaded the wsdl file and added it as reference to my C# solution.
When I try to run the quickstart solution, I get the following error
The underlying connection was closed: Unable to connect to the remote server.
   at System.Net.HttpWebRequest.CheckFinalStatus()
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN
ame, Object[] parameters)
   at quickstart_cs.sforce.SforceService.login(String username, String password)
 in c:\program files\salesforce.com\appexchange developer network\quickstart\app
exchange developer network\csharp .net\quickstart_cs\web references\sforce\refer
ence.cs:line 47
   at quickstart_cs.Class1.doLogin() in c:\program files\salesforce.com\appexcha
nge developer network\quickstart\appexchange developer network\csharp .net\quick
start_cs\quickstart.cs:line 210
Internet Access is through a firewall and when I try to access the webservices url

https://www.salesforce.com/services/Soap/c/7.0. I get the following error message.

400 GET not supported

Resin-3.0.12 (built Wed, 23 Feb 2005 10:29:38 PST)

Does anybody know what could be the reason for this



Gareth DaviesGareth Davies


try downloading Datascope or Developer's Sidekick (link at bottom of this mail). They are written in c# .Net. Try to see if they let you connect, it uses pretty much the same code as the samples. It'll help you isolate the problem at least.





Hi Gareth,

I downloaded the datascope trial version software and when I try to connect to the salesforce, I still get the same error message that I got in the sample C# code.

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

Any suggestions on what could be the possible reason for this error.


It seems like this might be a proxy server issue.  Are you behind a proxy server?
I changed the proxy server that I was using and now I am able to login.
Thanks a lot for the suggestion.
I am having this same issue, but it I only have the issue when I am not in my company's office and behind a proxy. I have created a couple of different dotNet clients one using Windows Forms and on console. Both connect fine when in the office behind the proxy. I do not have any code in the clients that specifically tell it to use a proxy or not. When I am at home however, behind a router on a broadband internet connection, the clients will not connect. I have turned of any proxy settings in IE, not that that matters. I am not sure what is going on. It is not a proxy issue.