By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,843 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,843 IT Pros & Developers. It's quick & easy.

The remote server returned an error: (500) Internal Server Error

P: 3
Hi all,

I am getting "The remote server returned an error: (500) Internal Server Error" exception. I have written the following code in VS.NET2005 using C# :

WebRequest wr = WebRequest.Create("http://www.ebizautos.com/search-cars/acura-cl-2.2-1997.html");
WebResponse wrs = wr.GetResponse();
Stream strm = wrs.GetResponseStream();

StreamReader SR = new StreamReader(strm);
string str = SR.ReadLine();
string input = "";
while (str != null)
{
input = input + str;
str = SR.ReadLine();
}
It is giving the exception on WebResponse wrs = wr.GetResponse(); statement.
This url is working fine otherwise on the browsers.


Can anybody please help me out to resolve this problem....

Thanks in advance!
Barnali
Sep 6 '07 #1
Share this Question
Share on Google+
4 Replies


kenobewan
Expert 2.5K+
P: 4,871
What is the exception?
Sep 6 '07 #2

Plater
Expert 5K+
P: 7,872
A 500 error occurs when the SERVER is having trouble.
It either really does have a problem, or you're sending some kind of malformed/incomplete request that it is not capable of finishing it's task and is bombing out.

Check with the company's website that you're trying to talk to to find out if they're working?
Sep 6 '07 #3

P: 3
Hi,
First of all, thanks for a quick reply....!!!

Exception is "The remote server returned an error: (500) Internal Server Error"

This error comes specifically while navigating to "http://www.ebizautos.com/search-cars/acura-cl-2.2-1997.html" programatically using WebRequest and WebResponse. All other urls are working fine except this one. I am unable to find out the reason behind this.

Thnks,
Barnali

What is the exception?
Sep 7 '07 #4

P: 3
Hi,
First of all, thanks for a quick reply...!!!

Url is "http://www.ebizautos.com/search-cars/acura-cl-2.2-1997.html".

Actually I am navigating to the webpages through WebRequest and WebResponse classes. All other urls are navingating properly except this one.

This url is working fine otherwise. Even I have tried to navigate to this url using the "WebBrowser" cotrol in Windows Application in .NET. The "webrowser" control navigates to this url successfully. But when I am try to do this using WebRequest and WebResponse, It is raising that exception.


Thanks,
Barnali

A 500 error occurs when the SERVER is having trouble.
It either really does have a problem, or you're sending some kind of malformed/incomplete request that it is not capable of finishing it's task and is bombing out.

Check with the company's website that you're trying to talk to to find out if they're working?
Sep 7 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.