I think I have developed a better method to "wake up" the sleepy map services. Here is a generic HTM page I have created utilizing the JavaScript API that will automatically run through all the available MapServer services that exist on the server in REST. It loads them into a single map on the page. I am going to set the VBS script to point to this page and open it up every 20 minutes.I understand that the "sleepy map service" issue is supposed to be solved in ArcGIS Server 10, but for those of us staying in 9.x a little longer, perhaps this will provide some relief.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>ArcGIS REST Map Services Keep Alive</title>
<link rel="stylesheet" href="https://community.esri.com/ArcGIS/rest/ESRI.ArcGIS.Rest.css">
<link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/1.6/js/dojo/dijit/themes/tundra/tundra.css">
<style type="text/css">html, body { height: 100%; width: 100%; margin: 0; padding: 0; }</style>
</head>
<body class="tundra">
<script type="text/javascript">var djConfig = {parseOnLoad: true};</script>
<script type="text/javascript" src="http://serverapi.arcgisonline.com/jsapi/arcgis/?v=1.6"></script>
<script type="text/javascript" src="/ArcGIS/rest/services?f=json&callback=var ws_results ="></script>
<script type="text/javascript">
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("esri.map");
var map;
var hostName = document.location.host;
function Init() {
map = new esri.Map("mapDiv");
//cycles through REST services and adds MapServer services to map
for(var i=0; i<ws_results.services.length; i++){
if (ws_results.services.type == 'MapServer') {
layer = new esri.layers.ArcGISDynamicMapServiceLayer("http://" + hostName + "/ArcGIS/rest/services/" + ws_results.services.name + "/MapServer");
map.addLayer(layer);
}
}
//resize the map when the browser resizes
var resizeTimer;
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('mapDiv'), 'resize', function() { //resize the map if the div is resized
clearTimeout(resizeTimer);
resizeTimer = setTimeout( function() {
map.resize();
map.reposition();
}, 500);
});
});
}
dojo.addOnLoad(Init);
</script>
<div id="mapContainer" dojotype="dijit.layout.BorderContainer" design="headline" gutters="false" style="width: 100%; height: 100%; margin: 0;">
<div id="mapDiv" dojotype="dijit.layout.ContentPane" region="center" style="overflow:hidden;">
</div>
</div>
</body>
</html>