473,394 Members | 1,840 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,394 software developers and data experts.

500 Internal Server Error

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.
Mar 1 '06 #1
3 4532
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
Mar 1 '06 #2
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

Mar 1 '06 #3
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
Mar 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: | last post by:
I am accessing the same error-containing ASP page on an ISP server using w2k IE6 but with different effect. On the first computer I get several line of HTML outputed by ASP, shown correctly by...
5
by: Ben | last post by:
hi when I try to excecute an ASP (either JS or VB) script to say, access a database record, I get an Internal Server Error HTTP 500.100 Why? and HOW CAN I FIX THIS? Thanks
4
by: Patrick Masson | last post by:
Hello, Our configuration : Apache 2.0.53 PHP 5.0.4 PC Windows 2000 MATLAB 6.1 We work on a consulting project in France which involves MATLAB Web server,
8
by: Rod | last post by:
I have been working with ASP.NET 1.1 for quite a while now. For some reason, opening some ASP.NET applications we wrote is producing the following error message: "The Web server reported...
4
by: jf li | last post by:
I have a Asp.net web application and a Asp.net Web service application. The Web application is using HtmlInputFile to get a 50M size of file selected by end user, read the data of this file and...
11
by: Lieven | last post by:
Hey, I had a hard disc problem last week on my server. I replaced the disc and copied al the files to the new hard disc, everything works fine again except some php scripts that are using the...
23
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; ...
0
by: ticfranca | last post by:
i'm getting an error at the line : $sth->execute() or die $dbh->errstr; the error is : The server encountered an internal error or misconfiguration and was unable to complete your request. Please...
3
by: rooznamechi.h | last post by:
Hi, I use Url rewriting on my website and my website works normally , but I don't know why Google crawlers can not read my pages . For example look at address below :...
3
by: guillaume.braux | last post by:
Hello, I am running WS2008 + IIS7 + FASTCGI + ZendCore. I have not modified the default ZendCore php.ini configuration file. Actualy, any kind of PHP error, warning or notice gives me...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.