Robert,I have an application that runs as a scheduled task that basically parses my /ArcGIS/rest/services directory and opens each service. I wrote it a while ago, with no documentation, so take it as it is.I have attached a zip file, which I have had no luck with attaching, so I have also include the source code that you could copy into a console appliction.Imports System.Threading
Imports System.Net
Module agsServicesWakeUp
Sub Main()
readHTML()
End Sub
Private Sub readHTML()
Try
Dim objWebClient As New WebClient
objWebClient.UseDefaultCredentials = True
Dim aRequestHTML() As Byte = objWebClient.DownloadData("http://yourservername/ArcGIS/rest/services") 'Change to your server
Dim counter As Integer = 0
Dim html As String = ""
Do While counter < aRequestHTML.Length
html += Chr(aRequestHTML.GetValue(counter))
counter = counter + 1
Loop
Dim serviceFolderArray() As Object = {}
Dim i As Integer = 0
Dim j As Integer = 1
Dim count As Integer = 0
Do While i < html.Length
i = InStr(j, html, "/ArcGIS/rest/services/")
If i > 0 Then
j = InStr(i, html, ">") - 1
Dim serviceFolder() As String = {html.Substring(i - 1, j - i)}
Array.Resize(serviceFolderArray, count + 1)
Array.ConstrainedCopy(serviceFolder, 0, serviceFolderArray, count, 1)
count = count + 1
i = j
Else
i = 0
j = 1
count = 0
Exit Do
End If
Loop
Dim k As Integer = 0
Dim servicesArray() As Object = {}
Do While k < serviceFolderArray.Length
objWebClient.UseDefaultCredentials = True
Dim serviceRequestHTML() As Byte = objWebClient.DownloadData("http://yourservername" + serviceFolderArray(k).ToString) 'Change to your server name
counter = 0
html = ""
Do While counter < serviceRequestHTML.Length
html += Chr(serviceRequestHTML.GetValue(counter))
counter = counter + 1
Loop
Do While i < html.Length
i = InStr(j, html, serviceFolderArray(k).ToString + "/")
If i > 0 Then
j = InStr(i, html, ">") - 1
Dim service() As String = {html.Substring(i - 1, j - i)}
Array.Resize(servicesArray, count + 1)
Array.ConstrainedCopy(service, 0, servicesArray, count, 1)
count = count + 1
i = j
Else
i = 0
j = 1
Exit Do
End If
Loop
k += 1
Loop
callURL(servicesArray)
callURL(servicesArray)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub callURL(ByVal servicesArray As Object, Optional ByVal sleep As Integer = 100)
Dim i As Integer = 0
Dim webApp
webApp = CreateObject("InternetExplorer.Application")
webApp.Visible = False
Do While i < servicesArray.Length
Console.WriteLine("http://yourservername" + servicesArray(i).ToString) 'Change to your server name
webApp.Navigate("http://yourservername" + servicesArray(i).ToString) 'Change to your server name
Thread.Sleep(sleep)
i += 1
Loop
webApp.quit()
webApp = Nothing
End Sub
End Module