public string GetToken(string uri) { foreach (ServerUrl su in serverUrls) { if (su.MatchAll && uri.StartsWith(su.Url, StringComparison.InvariantCultureIgnoreCase) && su.DynamicToken) { // Code to dynamically get the token string tokenService = string.Format("https://{0}/ArcGIS/tokens?request=getToken&username={1}&password={2}&expiration=30", su.Host, su.UserName, su.Password); string token;
esri.request({ url: "https://myserver.mo.gov/ArcGIS/tokens", content: { request: "getToken", username: usr, password: pwd }, handleAs: "text", load: tokenObtained, error: tokenRequestFailed });
String[] serverUrls = { //"<url>[,<token>]" //For ex. (secured server): "http://myserver.mycompany.com/arcgis/rest/services,ayn2C2iPvqjeqWoXwV6rjmr43kyo23mhIPnXz2CEiMA6rVu0xR0St8gKsd0olv8a" //For ex. (non-secured server): "http://sampleserver1.arcgisonline.com/arcgis/rest/services" };
String[] serverUrls = { "http://mydomain/arcgis/rest/services,my Token" }
esri.arcgis.gmaps.Config.alwaysUseProxy = true; esri.arcgis.gmaps.Config.proxyUrl = "./proxy.jsp"
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.