<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>
<?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>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY></BODY></HTML>
XML Parsing Error: no element found Location: http://servername/proxy.ashx?http://google.com Line Number 1, Column 1:
The ProxyConfig element is not declared
XML Parsing Error: no element found Location: http://servername/proxy.ashx?http://Server.Name.com/ArcGIS/rest/services/cadaster/ServiceName/MapServer Line Number 1, Column 1:
<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://Server.Name2.com/ArcGIS/rest/services/Counties/MapServer"); map.addLayer(CountyDataLayer); var RestrictedLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://Server.Name2.com/ArcGIS/rest/services/cadaster/ServiceName/MapServer?token=ZwBeUJKkl5L6bSitvEGgRy7hy52NmqBF8GIFCnB-7Lg."); 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>
<?xml version="1.0" encoding="utf-8" ?> <ProxyConfig mustMatch="true"> <serverUrls> <serverUrl url="http://Server.Name2.com/ArcGIS/rest/services/cadaster/ServiceName/MapServer" matchAll="true" token="ZwBeUJKkl5L6bSitvEGgRy7hy52NmqBF8GIFCnB-7Lg."></serverUrl> </serverUrls> </ProxyConfig>
esri.config.defaults.io.proxyUrl = "../proxy.ashx"; Change the URL to a complete server URL : http://servername/proxy.ashx <serverUrl url="http://Server.Name2.com/ArcGIS/rest/services/cadaster/ServiceName/MapServer" </serverUrls> Change the URL above to http://ServerName/ArcGIS/rest
esri.config.defaults.io.proxyUrl = "../proxy.ashx";
<serverUrl url="http://Server.Name2.com/ArcGIS/rest/services/cadaster/ServiceName/MapServer" </serverUrls>
<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 = "http://gisweb/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://Server.Name2.com/ArcGIS/rest/services/Counties/MapServer"); map.addLayer(CountyDataLayer); var RestrictedLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://Server.Name2.com/ArcGIS/rest/services/cadaster/AboriginalUseArea/MapServer"); map.addLayer(RestrictedLayer); } dojo.addOnLoad(Init); </script>
<?xml version="1.0" encoding="utf-8" ?> <ProxyConfig mustMatch="true"> <serverUrls> <serverUrl url="http://Server.Name2.com/ArcGIS/rest/" matchAll="true" host="10.10.10.51" token="ZwBeUJKkl5L6bSitvEGgRzZquMaWltg0GZY_xbGzVIA."></serverUrl> <serverUrl url="http://www.google.com" matchAll="true"></serverUrl> </serverUrls> </ProxyConfig>
Hello,When you go to http://Server.Name/ArcGIS/tokens/gettoken.htmlAnd you get the screen like the attached, do you create the token using the ip address of Server.Name?
Secure connection (SSL) required.
Also, is this an externally facing server? If so, do you have a reverse proxy set up?
<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.alwaysUseProxy = true; esri.config.defaults.io.proxyUrl = "http://WebServerName/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://Server.Name/ArcGIS/rest/services/Counties/MapServer"); map.addLayer(CountyDataLayer); var RestrictedLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://Server.Name/ArcGIS/rest/services/cadaster/ServiceName/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>
<?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"> <serverItems> <serverItem url="http://Server.Name" matchAll="true" tokenUrl="http://Server.Name/ArcGIS/tokens" username="MyUserName" password="MyPassword" timeout="5" /> </serverItems> </ProxyConfig>
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.