glad to hear it Daniel. thanks for taking the time to recap.
<serverUrl url="https://services2.arcgis.com/gGQziFjRK38YOiW5/arcgis/rest/services" username="UserName" password="Password" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl> <serverUrl url="https://www.arcgis.com" username="UserName" password="Password" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl> <serverUrl url="http://www.arcgis.com" username="UserName" password="Password" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl>
<link rel="stylesheet" href="https://js.arcgis.com/3.9/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="https://js.arcgis.com/3.9/js/esri/css/esri.css"> <script src="https://js.arcgis.com/3.9/"></script>
<serverUrl url="http://www.arcgis.com" username="AAA" password="xyz" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl>
thats fine. you can tell them you'd like to work with me specifically if you want 🙂appId/appSecret should not be thought of as a way to authenticate and access shared content. those credentials are specifically intended to allow an application to access subscription services which burn credits without requiring someone to sign in, or provide information to identify an app which uses an OAuth2 technique to have people sign in with their own credentials to work with private content.
<serverUrl url="https://services2.arcgis.com/gGQziFjRK38YOiW5/arcgis/rest/services" username="USER" password="PW" rateLimit="600" rateLimitPeriod="60" matchAll="false"> </serverUrl>
<serverUrl url="http://www.arcgis.com" clientId="ID" clientSecret="SECRET" username="USER" password="PW" rateLimit="600" rateLimitPeriod="60" matchAll="true"> </serverUrl>
<serverUrl url="https://services2.arcgis.com/gGQziFjRK38YOiW5/arcgis/rest/services" clientId="ID" clientSecret="SECRET" username="USER" password="PW" rateLimit="600" rateLimitPeriod="60" matchAll="false"> </serverUrl>
esriConfig.defaults.io.proxyUrl = "http://localhost:54254/proxy/proxy.ashx"; esriConfig.defaults.io.alwaysUseProxy = true;
you can set permissions on individual items (that you own) in ArcGIS Online by navigating to their item details page and clicking "share"[ATTACH=CONFIG]34341[/ATTACH]http://esrihack.maps.arcgis.com/home/item.html?id=a3e05a39087c4a768d43ae231ea158e0
are your own REST services public or do they require authentication? if so, are you including the credentials for that specific resource in the proxy.config?if you try to use the proxy directly in the browser to access the REST endpoint is it successful?ie:http://yourmachine/folder/proxy.ashx?http://services2.arcgis.com/arcgis/blah....
http://yourmachine/folder/proxy.ashx?http://services2.arcgis.com/arcgis/blah....
Yeah thanks although not quite fine yet as still getting the challenges caused by the layers.At the mo i have routed everything through the proxy and added the config for the https://services2 address but no joy.
glad to hear i was able to help sort you out. you'll want to use either http or https across the board for resources and your actual application to avoid mixed protocol errors thrown by the browser.
I have just manually generated the token and manually constructed map call and I get the same error so I am it does not look like the proxy is causing the problem. Could it be layers on the map?
Hi JohnIndeed the issue was www however I am still having further trouble.It still challenges and debugging the proxy I see that the following json is returned when it tries to get the actual map.{"error":{"code":403,"messageCode":"GWM_0003","message":"You do not have permissions to access this resource or perform this operation.","details":[]}}I have admin rights on the system and am using my credentials. I have checked the map is shared etc but do not seem to be able to locate any other settings that might affect this. Any ideas?Thanks again for the taking the time to assist,D
yup. mustMatch="true" causes the proxy to compare the request to the whitelist in the proxy.config. if the url stub is not an exact match, it will throw an error rather than fetch the page and hand it back to you.from what i saw before, you had 'arcgis.com' but not 'www.arcgis.com'.
if (mustMatch) throw new ArgumentException("Proxy is being used for an unsupported service:");
Daniel, if you snoop the web traffic when you launch your application you should see that a request to retreive the private webmap json is specifically whats failing. http://www.arcgis.com/sharing/rest/content/items/cd23069c1aeb44f79e072932d30bccac/data?f=json this can be resolved by adding the following serverUrl tag to your proxy.config. <serverUrl url="http://www.arcgis.com" username="john" password="doe" matchAll="true"> </serverUrl> after updating your proxy.config, try adapting this sample (i just confirmed it works fine) <!DOCTYPE html> <html> <head> <title>Create a Web Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"> <style> html,body,#mapDiv,.map.container{ padding:0; margin:0; height:100%; } </style> <script>var dojoConfig = { parseOnLoad:true };</script> <script src="http://js.arcgis.com/3.9compact/"></script> <script> require([ "esri/map", "esri/arcgis/utils", "esri/urlUtils", "esri/config", "dojo/domReady!" ], function (Map, arcgisUtils, urlUtils, esriConfig) { //define proxy rule urlUtils.addProxyRule({ proxyUrl: "/sproxy/proxy.ashx", urlPrefix: "www.arcgis.com/sharing/rest" }); //swap for your own private webmap arcgisUtils.createMap("cd23069c1aeb44f79e072932d30bccac", "mapDiv"); }); </script> </head> <body> <div id="mapDiv"></div> </body> </html>
<serverUrl url="http://www.arcgis.com" username="john" password="doe" matchAll="true"> </serverUrl>
<!DOCTYPE html> <html> <head> <title>Create a Web Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"> <style> html,body,#mapDiv,.map.container{ padding:0; margin:0; height:100%; } </style> <script>var dojoConfig = { parseOnLoad:true };</script> <script src="http://js.arcgis.com/3.9compact/"></script> <script> require([ "esri/map", "esri/arcgis/utils", "esri/urlUtils", "esri/config", "dojo/domReady!" ], function (Map, arcgisUtils, urlUtils, esriConfig) { //define proxy rule urlUtils.addProxyRule({ proxyUrl: "/sproxy/proxy.ashx", urlPrefix: "www.arcgis.com/sharing/rest" }); //swap for your own private webmap arcgisUtils.createMap("cd23069c1aeb44f79e072932d30bccac", "mapDiv"); }); </script> </head> <body> <div id="mapDiv"></div> </body> </html>
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.