Classic ASP post and receive XML
Hey I've been trying for hours to receive a XML via a classic ASP page but it just wont work.
Here my code:
post.asp
url = "http://myurl.com/receive.asp"
information = "Colt Taylor 100 "
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send information
receive.asp
Dim objXmlRequest
Set objXmlRequest = Server.CreateObject("MSXML2.DOMDOCUMENT.3.0")
objXmlRequest.async = False
objXmlRequest.setProperty "ServerHTTPRequest", True
objXmlRequest.validateOnParse = True
objXmlRequest.preserveWhiteSpace = True
IF objXmlRequest.Load (Request) THEN
'GET THE REQUEST FROM CLIENT
strQuery = "//" & "ActionName"
Set oNode = objXmlRequest.selectSingleNode(strQuery)
strActionName = oNode.Text
response.write("success")
ELSE
Response.Write "Failed to load XML file, reason: " & objXmlRequest.parseError.reason
END IF
This error appears:
Failed to load XML file, reason: XML document must have a top level element.
I just don't get it. Also i want to know if there is a posibilty to save the loaded XML?