Simpel test af asp-kode
Jeg kan ikke selv køre asp-kode på min hjemmesideSå inden jeg prøver at oversætte følgende kode vil jeg gerne om jeg kan få en til at uploade til deres egen server så jeg kan se om det virker efter hensigten.
På forhånd tak for hjælpen
<%@ Language=VBScript %>
<% OPTION EXPLICIT %>
<html>
<head>
<title>GolfBox Nyheds WebService TEST</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<style type="text/css">
body {
font-family: tahoma;
font-size: 10pt
}
A{
font-family: tahoma;
font-size: 10pt;
text-decoration: none;
color: blue;
}
A:visited {
font-family: tahoma;
font-size: 10pt;
text-decoration: none;
color: blue;
}
A:Hover{
text-decoration: underline;
}
</style>
</head>
<body>
<%
dim Account, Username, Password, WebService_URL
Account = "DEMO_415_Standard"
Username = "DEMO_415_Standard"
Password = "1234"
WebService_URL = "http://demo.golfbox.dk/web/services/webservice/news.asmx"
dim soapMessage, SOAPObject, soapResult
soapMessage = "<?xml version=""1.0"" encoding=""utf-8""?>" &_
"<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" &_
"<soap:Header>" &_
"<UserCredentials xmlns=""http://golfbox.net/web/services/webservice"">" &_
"<Account>" & Account & "</Account>" &_
"<Username>" & Username & "</Username>" &_
"<Password>" & Password & "</Password>" &_
"</UserCredentials>" &_
"</soap:Header>" &_
"<soap:Body>" &_
"<GetList xmlns=""http://golfbox.net/web/services/webservice/news"">" &_
"<HeadersOnly>false</HeadersOnly>" &_
"</GetList>" &_
"</soap:Body>" &_
"</soap:Envelope>"
set SOAPObject = server.CreateObject("MSXML2.ServerXMLHTTP")
call SOAPObject.Open("POST", WebService_URL, false)
call SOAPObject.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
call SOAPObject.setRequestHeader("Content-Length", len(soapMessage))
call SOAPObject.setRequestHeader("SOAPAction", "http://golfbox.net/web/services/webservice/GetList")
call SOAPObject.send(soapMessage)
if SOAPObject.ReadyState = 4 then
set soapResult = server.CreateObject("msxml2.domdocument.4.0")
call soapResult.loadXML(SOAPObject.responseText)
dim nodes : set nodes = SOAPResult.selectNodes("//NewsItem")
dim g
for g = 0 to nodes.length - 1
if nodes(g).selectSingleNode("GUID").text = request.QueryString("News_GUID") then
response.Write("<b>» <a href=""ws_getnews.asp?News_GUID=" & server.URLEncode(nodes(g).selectSingleNode("GUID").text) & """>" & nodes(g).selectSingleNode("Subject").text & "</a></b><br>")
response.Write("<div style=""padding-left:15px"">" & nodes(g).selectSingleNode("Body").text & "</div><br/>")
else
response.Write("» <a href=""ws_getnews.asp?News_GUID=" & server.URLEncode(nodes(g).selectSingleNode("GUID").text) & """>" & nodes(g).selectSingleNode("Subject").text & "</a><br>")
end if
next
end if
%>
</body>
</html>