Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XMLHTTP - Post xml to server and get answer back

Status
Not open for further replies.

IlseDC

Programmer
Mar 24, 2003
49
BE
In my html script I use XMLHTTP to post an xml document to the server. The server program has to send an answer to the client.
In the ASP I send "successful" back to the client.
But on the clientside I do not get back the "successful", I get an empty page.
What is the problem?

Thanks.
Ilse

Here is my clientside script:

function Save() {

var myXMLDoc;
var myXMLHttp;
var strXML;

strXML = "<Root><Item>ID1</Item><Item>ID2</Item></Root>";

myXMLDoc = new ActiveXObject('Msxml2.DOMDocument');
myXMLDoc.async = false;
myXMLDoc.loadXML(strXML);

myXMLHttp = new ActiveXObject('Msxml2.XMLHTTP');
myXMLHttp.open('POST', ' false);
myXMLHttp.send(myXMLDoc);

document.write(myXMLHttp.responseText);
}


This is the ASP code:

<%@ LANGUAGE="JSCRIPT" %>

<%
var myXMLDoc = Server.CreateObject("Msxml2.DOMDocument");
var strOutFile;

myXMLDoc.load(Request);
strOutFile = "Test.xml";
myXMLDoc.save(Server.MapPath(strOutFile));

response.write("Successful");
%>
 
The Server.CreateObject is in the asp, so on the server side.
The script on the client side does the XMLHTTP request.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top