Thank you very much, Harold. I think I'm closer to getting there but my code still isn't retrieving a token from the proxy page.Here's the JavaScript code:<script type="text/javascript">
dojo.require("esri.map");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.BorderContainer");
var map;
function Init() {
esri.config.defaults.io.proxyUrl = "../proxy.ashx";
dojo.style(dojo.byId("map"), { width: dojo.contentBox("map").w + "px", height: (esri.documentBox.h - dojo.contentBox("navTable").h - 40) + "px" });
map = new esri.Map("map");
var CountyDataLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servername/ArcGIS/rest/services/Counties/MapServer");
map.addLayer(CountyDataLayer);
// the following service requires a token:
var RestrictedLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://servername/ArcGIS/rest/services/Cadaster/CadasterLayerHalfTransparent/MapServer");
map.addLayer(RestrictedLayer);
var resizeTimer;
dojo.connect(map, 'onLoad', function(theMap) {
dojo.connect(dijit.byId('map'), 'resize', function() {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(function() {
map.resize();
map.reposition();
}, 500);
});
});
}
dojo.addOnLoad(Init);
</script>
and here's the code from the proxy.ashx page:<?xml version="1.0" encoding="utf-8" ?>
<!-- Proxy config is used to set the ArcGIS Server services that the proxy will forward to.
mustMatch: true to only proxy to sites listed, false to proxy to any site -->
<ProxyConfig mustMatch="true">
<serverUrls>
<!-- serverUrl options:
url = location of the ArcGIS Server, either specific URL or stem
matchAll = true to forward any request beginning with the url
token = (optional) token to include for secured service
dynamicToken = if true, gets token dynamically with username and
password stored in this file.
userName = the secured user's username
password = the password for the username
host = the machine name that is hosting the map service
-->
<serverUrl url="http://servername/ArcGIS/rest/services/Cadaster/CadasterLayerHalfTransparent/MapServer"
matchAll="true"
dynamicToken="true"
host="servername"
userName="UserName"
password="ValidPassword"></serverUrl>
<serverUrl url="http://www.google.com"
matchAll="true"></serverUrl>
</serverUrls>
</ProxyConfig>
I get no errors now. I'm still not getting the service that requires a token though....Any ideas?