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?
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?