Help needed - How to deal with XML data posted using HTTP_POST

D

DrNASA

Posting to ASP page using the Web Server(HTTP) option.

How can I deal with the XML data once it gets to the ASP page?

Is there a temp XML file saved somewhere? The only methods I can find in ASP
of dealing with posted XML data require that I know the file name and
location.

It does not appear as if I can just do a Request(obj).

Thanks
 
N

Nic Roche

Hi,

How can I deal with the XML data once it gets to the ASP page?

<snip src="MSDN">

<%@ language=javascript %>
<%
Response.Expires = -1000;
// Load the posted XML document.
var doc = Server.CreateObject("Msxml2.DOMDocument");
doc.load(Request);
var result = Server.CreateObject("Msxml2.DOMDocument");
// Now process the order and build the result document.
Response.ContentType = "text/xml";
result.save(Response);
 
D

DrNASA

I need it to be server side though. How to do that?

Here is what is going on: (ideally)
The form is submited to the asp page, but a browser isn't open. The ASP page
will then create a new XML document based on the submitted HTTP_POST data.
The users will be able to access an ASP page that is built from the new XML
page from a web page at their convenience.

I know it's convoluted a bit, but I'm pushing the envelope of what Infopath
was designed to do.

Thanks
 
D

DrNASA

I got it, friggin' finally, here is my server side code:

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then 'this is just a
test

Dim objname
Dim objFSO
Dim objTextFile

set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
xmldoc.async=false
xmldoc.load(Request)

'### create write txt file objects ###

' Create an instance of the the File System Object and assign it to objFSO.
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Open the file
Set objTextFile = objFSO.CreateTextFile(Server.MapPath("survery_results.txt"))

'####################

for each x in xmldoc.documentElement.childNodes
objname = x.text
objTextFile.WriteLine(x.text)
next

objTextFile.Close

End If

%>

Thanks for your help!
 
N

Nic Roche

I need it to be server side though

Javascript is not just a client-side scripting language.

That was server-side code...


Nic Roche
 

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

Top