|
|
|
<%
Function GetActiveCourses()
Dim arrSessions, xmlhttp, dom, url, node, i, j
'***************************************************************************
'set up call to the web service for Last Updated date
'***************************************************************************
'Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP")
Set xmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
Set dom = Server.CreateObject("Microsoft.XMLDOM")
url = "http://tier2.iema.state.il.us/Training/Training.asmx/GetWebMenu"
'set option to ignore SSL errors
const SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
Call xmlhttp.setOption(2, SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS)
'call web service
Call xmlhttp.Open("GET", url, False)
Call xmlhttp.send
'Parse xml result
dom.Load(xmlhttp.responseBody)
Set node = dom.SelectSingleNode("//string")
'did we get a response back from the server?
If not node is nothing then
'yes - convert the xml to an array
dom.LoadXML(node.text)
'Did we find any records for the search criteria?
If not dom.SelectSingleNode("//NewDataSet/Table") is nothing then
Set rows = dom.SelectNodes("//NewDataSet/Table")
For i = 0 To rows.length - 1
ReDim Preserve arrItems(2,i)
For j = 0 to rows(i).childNodes.length - 1
arrItems(j,i) = rows(i).childNodes(j).text
Next
Next
'clean up your mess
set doc = nothing
set xmlhttp = nothing
GetActiveCourses = arrItems
Else
'clean up your mess
set doc = nothing
set xmlhttp = nothing
End If
Else
'clean up your mess
set doc = nothing
set xmlhttp = nothing
End If
End Function
arrCourses = GetActiveCourses()
If IsArray(arrCourses) Then
strSideMenu = " |