System.Net.WebException: The remote server returned an error: (500) Internal Ser

Hi All,

I am not a .Net developer basically,but I have been given the task to look into why an application built on .NET framework gets an error while trying to access our GUI which has been built on JAVA and STRUTS.

I was trying to debug the application by putting

System.Windows.Forms.MessageBox.Show() whereever I suspected the problem to be and then started the server in debug mode. It seems that the below line is the culprit -

byte[] responseArray =
mWebClient.UploadValues(URL, "POST", paramList);

paramList is an instance of NameValueCollection and URL is a valid representation of the URL to the GUI I want to access in String format.

This is the stack trace of the error I get -

System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
at System.Net.WebClient.UploadValues(Uri address,String method,NameValueCollectionData data)
at System.Net.WebClient.UploadValues(String address,String method,NameValueCollectionData data)
.
.
.

I did some google on the above errror and the closest thing I got was that for version 1.1 and higher of .NET, the machine.config has the entries for httpPost and httpGet commented by default, but I tried that and still I am unable to resolve my issue.

Can someone please help me with this issue ??

Thanks and Regards,
Aryaan
[1422 byte] By [aryaan81] at [2007-11-20 11:00:48]
# 1 Re: System.Net.WebException: The remote server returned an error: (500) Internal Ser
Well, the error is on your webserver not on your webclient. So try to debug the serverside code.
torrud at 2007-11-9 11:36:05 >
# 2 Re: System.Net.WebException: The remote server returned an error: (500) Internal Ser
Hi Torrud..

Can you please be little more specific.. As I am really new to .NET and anything wouldnt be obvious to me at this stage.

Also, I am hoping that there is some problem at the client side itself because of which the server is not able to tell the exact errror. However, I cant tell anything for sure..

Thanks and Regards,
Aryaan
aryaan81 at 2007-11-9 11:37:06 >
# 3 Re: System.Net.WebException: The remote server returned an error: (500) Internal Ser
The HTTP Error 500 defines that a serverside error is occured during the execution of a request. That means that the server code throwed an exception.

There are two big areas you can have a look. At first on the server code itself. It seems that some of your request data brings the server code to crash. If you are sure that the server code works correct but there are only some issue with the error handling you can have a look to your client code.
Maybe the client sent the wrong request data to the server. To verify this you should use a network protocol analyzer like Wireshark (http://www.wireshark.org/). With it you can protocol all HTTP packets and have a look at it.

Without any kind of information it is impossible to fix this error.
torrud at 2007-11-9 11:38:16 >