|
<!--TOOLBAR_START--> <!--TOOLBAR_EXEMPT--> <!--TOOLBAR_END-->
<%@ language=javascript %>
<%
Response.Expires = -1000;
if (Request.ServerVariables("REQUEST_METHOD") == "POST")
{
var xmlise ,xmlstr,reason_str,doc;
xmlise = Server.CreateObject ("DataEngine.DEng");
//xmlise = Server.CreateObject("DataEngine.DEng");
xmlise.ConnectionString = "PROVIDER=SQLOLEDB;DataSource=XMZY;Initial Catalog=pubs";
//xmlise.ConnectionString ="PROVIDER=SQLOLEDB;DataSource=XMZY";
xmlise.User ="SA";
xmlise.Password ="";
reason_str ="<pcommand>reptq1</pcommand>";
//xmlstr =xmlise.IsServerOK();
xmlstr =xmlise.GetData (reason_str);
//xmlstr= xmlise.GetCatalogs ();
//xmlstr=xmlise.GetColumns ("authors");
//xmlstr=xmlise.GetProcedures ();
//xmlstr=xmlise.GetData (reason_str);
// Load the posted XML document
//xmlstr="<test>abcd</test>";
doc = Server.CreateObject("Microsoft.XMLDOM");
doc.load(xmlstr);
doc.loadXML(xmlstr);
// and ping it right back to the client.
Response.ContentType = "text/xml";
doc.save(Response);
xmlise = null;
//Response.Write xmlstr;
}
else
{
var strPOSTURL = "http://" + Request.ServerVariables("SERVER_NAME") +
Request.ServerVariables("SCRIPT_NAME");
%>
<html>
<script language="javascript">
function postXML()
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST", "<%=strPOSTURL%>", false);
//alert(XML.value );
xmlhttp.Send(XML.value);
//alert("Round tripped XML document:\n\n"+xmlhttp.response);
//alert("Round tripped XML document:\n\n" + xmlhttp.responseXML.xml);
XML.innerText=xmlhttp.responseXML.xml;
//XML.innerText = xmlhttp.response;
}
</script>
<textarea id="XML" rows="12" cols="60"><XML>
This is the XML document that will be round tripped...
</XML></textarea>
<P>
<input type="button" value="PING" onclick="postXML()"></P>
<P>The source of the ASP script is:</P>
</html>
<%
}
%>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm write program from 1990. My research field is CAG,CAD and Image processing. I select C/C++, ASP, Java, XML as my usaully developing tools. Occasional , write code in Delphi and VB. I'm using Visual C++ from 1996. If you have anything unclear, e-mail to :zhou_cn123@sina.com Software Engineering and CAD is my mainly research program.
You also can reach me on msn: zhoujohnson@hotmail.com