Error

G

Guest

Hi, I am new to ASPX. I try to create a aspx page to handle the xml request.
I am just staring up the project. I am already error in my aspx page. I
couldnt solve it.

My ASPX page is bellow:

Imports System.IO
Imports System.Text
Public Class WebForm1
Inherits System.Web.UI.Page


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim str As String
Dim binData() As Byte
Dim counter
Dim Request As HttpRequest
Dim oStream As Stream
Dim i As Integer

binData = Request.BinaryRead(Request.TotalBytes)

For i = 0 To binData.Length - 1
oStream.WriteByte(binData(i))
Next

Dim sr As New StreamReader(oStream, Encoding.UTF8)
Dim results As String = sr.ReadToEnd()
sr.Close()

End Sub

End Class

I am using the following asp script to post the xml request on the above
aspx page:

dim oXMLHTTP, ts, fs
dim sURL, sData
set fs = CreateObject("Scripting.FileSystemObject")
set ts = fs.OpenTextFile ("C:\Excercise\ASP_Project\sampleXML.xml")
sData = ts.ReadAll

sURL = "http://localhost/Sample/WebForm1.aspx"

set oXMLHTTP = CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.open "POST", sURL, False
oXMLHTTP.send sData

msgbox oxmlhttp.status
msgbox oxmlhttp.responseText
set oXMLHTTP =Nothing
set fs = nothing

Why do i get xmlHttp status code 500 when i run the above asp script?
Could any one tell me whats wrong here and how to fix them?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to save byte stream as binary document 1
Request.InputStream 0
XMLHTTP status 500? 2
Request Object 4
xml parse error 0
Basic authentication Fails 3
XMLHTTP Status 500 1
FormView FindControl error 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top