this works beautifully using xmlhttp
my solution uses two files, "stockquotews.asp", and "stockquotes1.xsl"
rather than explain the code (which is pretty self-explanatory anyway), i've decided to include it all below:
STOCKQUOTEWS.ASP
====================================================
<%OPTION EXPLICIT%>
<%
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
dim sResponse
dim sSymbol
sSymbol = UCase(Trim(Request.Form("txtSymbol")))
if Trim(Request.Form("SUBMITTED")) = "TRUE" then
sResponse = GetWebServiceResultsViaXMLHTTP(sSymbol)
else
sResponse = "Request not yet submitted."
end if
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function GetWebServiceResultsViaXMLHTTP(byval sSymbol)
dim oXMLHTTP
dim sResult
dim sXML
dim sURL
sURL = "http://www.eggheadcafe.com/WebServices/stockquote/stockquote.asmx/GetQuote?symbol=" & sSymbol
set oXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
oXMLHTTP.open "GET", sURL, false
oXMLHTTP.send
sXML = oXMLHTTP.responseXML.xml
set oXMLHTTP = nothing
'Format it to be true XML format
sXML = Replace(Replace(Replace(Replace(sXML, "<", "<"), ">", ">"), "<string xmlns=""http://tempuri.org/"">", ""), "</string>", "")
'Transform the XML
sResult = TransformXML(sXML, Server.MapPath("stockquotes1.xsl"))
GetWebServiceResultsViaXMLHTTP = sResult
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function TransformXML(byval sXML, byval sXSLFilePath)
dim oXMLDoc
dim oXSLDoc
dim sResult
set oXMLDoc = Server.CreateObject("MSXML2.DOMDocument")
oXMLDoc.async = false
if oXMLDoc.loadXML(sXML) then
set oXSLDoc = Server.CreateObject("MSXML2.DOMDocument")
oXSLDoc.async = false
if oXSLDoc.load(sXSLFilePath) then
sResult = oXMLDoc.transformNode(oXSLDoc)
else
sResult = "<span class=""ErrorFont"">Failed to load XSL string into MSXML2.DOMDocument object.</span>"
end if
set oXSLDoc = nothing
else
sResult = "<span class=""ErrorFont"">Failed to load XML string into MSXML2.DOMDocument object.</span>"
end if
set oXMLDoc = nothing
TransformXML = sResult
end function
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<html>
<head>
<title>Stock Quote WebService Access Test</title>
<style>
.NormalFont{
font-family: arial, helvetica, verdana;
font-size: 10pt;
}
.ErrorFont{
font-family: arial, helvetica, verdana;
font-size: 10pt;
color: #cc0000;
}
</style>
</head>
<body onLoad="window.document.frmMain.txtSymbol.focus();">
<form id="frmMain" name="frmMain" method="post" action="stockquotews.asp">
<input type="hidden" name="SUBMITTED" value="TRUE">
<table border="0" cellspacing="0" cellpadding="0" align="center" style="border:1px solid #000000; padding:10px 10px 10px 10px;">
<tr>
<td class="NormalFont"><b>Enter Ticker Symbol:</b></td>
</tr>
<tr>
<td class="NormalFont">
<input type="text" id="txtSymbol" name="txtSymbol" value="<%=sSymbol%>" size="5" maxlength="5">
<input type="submit" id="subSubmit" name="subSubmit" value="Submit">
</td>
</tr>
<tr>
<td class="NormalFont">
<b>Response:</b>
<br><br>
<%=sResponse%>
</td>
</tr>
</table>
</form>
</body>
</html>
====================================================
STOCKQUOTES1.XSL
====================================================
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes" />
<!--
NOTE: The XML to be transfor