Very off topic, but I know we have some very experienced guys here…and like asking for directions or going to the Doctors, this is something I have put off asking for help with for a while.
I’m dabbling in web services and I have a particular use in mind.
That use sends POSTs to a target URL, but the body of the POST is an XML structure.
I’m new to ASP , and I realise things have moved on.
But I understand VBscript and if I can get something working with that to understand the concepts, I can then consider moving to something newer.
Everything I can find on the subject of receiving a Request suggests that there are two kinds of data:
Query String (a commandline style way of sending data, using pairs like JSON does it)
FORM data.
Now the body contains an XML structure, not form data, and I have spent a week failing to get that XML string out of the POST and into a string variable, or into an XMLDOC
I’d show you my code but Ive tried dozens of permutations and dont know which one was even close.
The most recent attempt looks like this but just errors:
Set Dom = CreateObject("Microsoft.XMLDOM")
dim xmlData
xmlData = Request.Form["xml"]
dom.LoadXml(xmlData)
This is how I am calling my test asp page. (It seems OK when I send the POST to someone else’s real server by the way)
[code]Set xmlhttp = WScript.CreateObject(“Microsoft.XMLHttp”)
Dim s
s = “<?xml version='1.0'?>”
s = s+ “”
s = s+ “aaaaaaaaaaaaaaaaaaaa
”
s = s+ “”
s = s+ “”
xmlhttp.open “POST”, “http://127.0.0.1/receiver/receive.asp” , False
xmlhttp.setRequestHeader “Content-Type”, “text/xml”
WScript.Echo "Sending request to the server… "
xmlhttp.send s
Wscript.echo "Response = " & xmlhttp.responseText[/code]
Maybe ASP is too old to expect an XML payload?
But has anyone done this before and can help me out before I consider self-mutilation?
( I realise that things have moved on, but for the moment, I want to start simple , using VBScript which I like, as opposed to a crash course in Visual Studio which I havent seen since 2003)