Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > 500 Internal Server Error

Reply
Thread Tools

500 Internal Server Error

 
 
=?Utf-8?B?QmVnaW5uZXI=?=
Guest
Posts: n/a
 
      03-01-2006
I get the following error when I send a HTTPWebRequest.

System.Net.WebException: The remote server returned an error: (500) Internal
Server Error. at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.GetResponse()

Below is the code that I wrote.
-------------------------------------

Dim xmlDOM As New XmlDocument

xmlDOM.Load("C:/Subs_Req.xml")

Dim strxml As String = xmlDOM.OuterXml
Dim myxml As String = "xml=" & strxml
Dim data() As Byte = System.Text.Encoding.UTF8.GetBytes(myxml.ToString( ))
Dim xml As String = System.Web.HttpUtility.UrlEncode(myxml)
Dim myURL As String= "https://xxxxxx.com:443/xxxx".ToString
Dim myRequest As HttpWebRequest = CType(WebRequest.Create(myURL),
HttpWebRequest)

myRequest.Method = "POST"
myRequest.ContentType = "application/x-www-form-urlencoded"
myRequest.ContentLength = data.Length
Dim NewStream As Stream = myRequest.GetRequestStream()

NewStream.Write(data, 0, data.Length)
NewStream.Close()
Dim myResponse As HttpWebResponse
myResponse = CType(myRequest.GetResponse(), HttpWebResponse)

Dim sr As StreamReader = New StreamReader (myResponse.GetResponseStream())
Dim response As String = sr.ReadToEnd()
-------------------------------------------------------------------------

Please advise.

Thanks.


 
Reply With Quote
 
 
 
 
Ward Bekker
Guest
Posts: n/a
 
      03-01-2006
Hi Beginner,

It seems that the post to the page on the remote server caused a 500
Server Error, meaning that an exception occured. Re-check if you are
posting the correct data, otherwise the receiving page is not programmed
correctly and needs to be corrected.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QmVnaW5uZXI=?=
Guest
Posts: n/a
 
      03-01-2006
Thanks for the response.

When I post the same information to a local server it just works fine. But
not to this. Mine is a simple asp.net app. The receiving page is also fine.
Do you think the external url being https could cause this problem?


"Ward Bekker" wrote:

> Hi Beginner,
>
> It seems that the post to the page on the remote server caused a 500
> Server Error, meaning that an exception occured. Re-check if you are
> posting the correct data, otherwise the receiving page is not programmed
> correctly and needs to be corrected.
>
> --
> Ward Bekker
> "Asp.Net Discussions for the Professional Developer"
> http://www.dotnettaxi.com
>
> "Free .Net 2.0 C# to/from VB.Net Code Converter"
> http://www.dotnettaxi.com/Tools/Converter.aspx
>

 
Reply With Quote
 
Ward Bekker
Guest
Posts: n/a
 
      03-01-2006
Hi Beginner,

A starting point might be to investigate what the actual exception is
that caused the 500 internal server error. If it's a asp.net app you can
specify in the web.config to show the exact exception to remote hosts.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/822319ev1'. 'HTTP/1.1 500 Internal Server Error'. chanmm ASP .Net 2 09-07-2010 07:37 AM
System.Net.WebException: The remote server returned an error: (500) Internal Server Error. kuladeep.mohan@gmail.com ASP .Net 5 08-26-2009 09:36 AM
The remote server returned an error: (500) Internal Server Error. BobbyOwens ASP .Net 0 01-23-2009 11:04 AM
System.Net.WebException: The remote server returned an error: (500) Internal Server Error. kuladeep.mohan@gmail.com ASP .Net Web Services 0 03-24-2006 03:10 PM
Web server reported following error... HTTP/1.1 500 Internal Server Error John Bonds ASP .Net 2 08-03-2004 10:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57