<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 503 Error using ArcGISDynamicMapServiceLayer in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/503-error-using-arcgisdynamicmapservicelayer/m-p/701408#M4918</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I am trying to show an ArcGISDynamicMapServiceLayer in my Android app (I am using 10.2.9). I am doing it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamicLayer = new ArcGISDynamicMapServiceLayer(url, null, creds);&lt;/P&gt;&lt;P&gt;dynamicLayer.setOpacity(0.4f);&lt;/P&gt;&lt;P&gt;mView.addLayer(dynamicLayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is showing nothing. The credentials have the correct user and password (I can log in via web in the page with those credentials). I get this trace:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my.whole.package.arcgislib E/ArcGIS: url =&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgispre.domain.es%2Farcgis%2Frest%2Fservices%2FGISC%2FMYSERVICE%2FMapServer" rel="nofollow" target="_blank"&gt;https://arcgispre.domain.es/arcgis/rest/services/GISC/MYSERVICE/MapServer&lt;/A&gt;&lt;SPAN&gt; com.esri.core.io.EsriServiceException: Service Unavailable at com.esri.core.internal.io.handler.c.a(SourceFile:690) at com.esri.core.internal.io.handler.h$1.handleResponse(SourceFile:200) at com.esri.core.internal.io.handler.h$1.handleResponse(SourceFile:197) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616) at com.esri.core.internal.io.handler.h.a(SourceFile:197) at com.esri.core.internal.io.handler.h.a(SourceFile:63) at com.esri.core.internal.tasks.ags.t.a(SourceFile:39) at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer.initLayer(SourceFile:280) at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer$2.run(SourceFile:261) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) I started debugging to see what was going on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcGISDynamicMapServiceLayer.class, there is a method called InitLayer. Inside, we have this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapServiceInfo var1 = this.serviceInfo != null ? (MapServiceInfo)this.serviceInfo : (new t(this.getUrl(), this.credentials)).a();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This line is where the exception is thrown. I go into the a() method, whatever it does. This is the method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public MapServiceInfo a() throws Exception { JsonParser var1 = h.a(this.serviceURL, (Map)null, this.getServiceCredentials()); MapServiceInfo var2 = MapServiceInfo.fromJson(var1, this.serviceURL); return var2; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first line, it goes to this method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public static final JsonParser a(String var0, Map&amp;lt;string, string=""&amp;gt; var1, n var2) throws Exception { return a(var0, (Map)var1, 1, var2); }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which call this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private static final JsonParser a(String var0, Map&amp;lt;string, string=""&amp;gt; var1, int var2, n var3) throws Exception { Object var4 = var1; JsonParser var5 = null; String var6 = a(var0, var3); try { HttpUriRequest var7 = null; AuthenticationType var15 = var3 != null &amp;amp;&amp;amp; var3.b != null ? var3.b.getAuthenticationType() : null; String var9; if (var15 == AuthenticationType.TOKEN &amp;amp;&amp;amp; !var0.contains("token=")) { var9 = a(var3); if (var9 != null) { if (var1 == null) { var4 = new HashMap(); } ((Map)var4).put("token", var9); } } else if (var15 == AuthenticationType.HTTP) { a(var0, var3.b); } var7 = c.a(var6, a((Map)var4), c(var3), false); var9 = (String)f.execute(var7, new BasicResponseHandler() { public String handleResponse(HttpResponse hresponse) throws IOException, HttpResponseException { c.a(hresponse); //EXCEPTION THROWN HERE return EntityUtils.toString(hresponse.getEntity(), "UTF-8"); } }); var5 = d.c(var9); var5.nextToken(); EsriSecurityException[] var10 = new EsriSecurityException[1]; String var11 = c.a(var9, var5, var6, var10, var2, var3); if (var11 != null) { return a(var11, (Map)var4, var2 + 1, var3); } if (var10[0] != null) { throw var10[0]; } } catch (SSLException var12) { throw new EsriSecurityException(-10004, "Untrusted server certificate from " + var6, var12); } catch (HttpResponseException var13) { if (var13.getMessage().contains("Unauthorized")) { throw new EsriSecurityException(-10001, "Invalid or missing user credentials", var13); } throw var13; } catch (EsriServiceException var14) { if (var14.getCode() == 401 || var14.getMessage().trim().contains("Unauthorized")) { throw new EsriSecurityException(-10001, "Invalid or missing user credentials", var14); } if (var14.getCode() != 302 &amp;amp;&amp;amp; var14.getCode() != 301) { throw var14; } String var8 = var14.getMessage(); var5 = a(var8, (Map)null, 1, var3); } return var5; } The exception is thrown in c.a(httpresponse) method, which is like this: static final void a(HttpResponse var0) { StatusLine var1 = var0.getStatusLine(); if (var1.getStatusCode() &amp;lt; 400 &amp;amp;&amp;amp; var0.getEntity() != null) { if (var1.getStatusCode() == 302 || var1.getStatusCode() == 301) { String var2 = var1.getReasonPhrase(); if (!var2.contains("?")) { Header var3 = var0.getFirstHeader("Location"); if (var3 != null) { var2 = var3.getValue(); } } throw new EsriServiceException(var1.getStatusCode(), var2); } } else { throw new EsriServiceException(var1.getStatusCode(), var1.getReasonPhrase()); } }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It fails to pass the first if statement, so it goes to the else, which is throwing a 503 code. Is there something I could do here? Is a server error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(For clearer reading, see here: &lt;A class="link-titled" href="https://gis.stackexchange.com/questions/301537/503-error-showing-arcgisdynamicmapservicelayer" title="https://gis.stackexchange.com/questions/301537/503-error-showing-arcgisdynamicmapservicelayer"&gt;arcgis 10.2 - 503 error showing ArcGISDynamicMapServiceLayer - Geographic Information Systems Stack Exchange&lt;/A&gt; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Nov 2018 10:02:43 GMT</pubDate>
    <dc:creator>DavidFernández_Arias</dc:creator>
    <dc:date>2018-11-06T10:02:43Z</dc:date>
    <item>
      <title>503 Error using ArcGISDynamicMapServiceLayer</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/503-error-using-arcgisdynamicmapservicelayer/m-p/701408#M4918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, I am trying to show an ArcGISDynamicMapServiceLayer in my Android app (I am using 10.2.9). I am doing it this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;dynamicLayer = new ArcGISDynamicMapServiceLayer(url, null, creds);&lt;/P&gt;&lt;P&gt;dynamicLayer.setOpacity(0.4f);&lt;/P&gt;&lt;P&gt;mView.addLayer(dynamicLayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is showing nothing. The credentials have the correct user and password (I can log in via web in the page with those credentials). I get this trace:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;my.whole.package.arcgislib E/ArcGIS: url =&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Farcgispre.domain.es%2Farcgis%2Frest%2Fservices%2FGISC%2FMYSERVICE%2FMapServer" rel="nofollow" target="_blank"&gt;https://arcgispre.domain.es/arcgis/rest/services/GISC/MYSERVICE/MapServer&lt;/A&gt;&lt;SPAN&gt; com.esri.core.io.EsriServiceException: Service Unavailable at com.esri.core.internal.io.handler.c.a(SourceFile:690) at com.esri.core.internal.io.handler.h$1.handleResponse(SourceFile:200) at com.esri.core.internal.io.handler.h$1.handleResponse(SourceFile:197) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:657) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:627) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:616) at com.esri.core.internal.io.handler.h.a(SourceFile:197) at com.esri.core.internal.io.handler.h.a(SourceFile:63) at com.esri.core.internal.tasks.ags.t.a(SourceFile:39) at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer.initLayer(SourceFile:280) at com.esri.android.map.ags.ArcGISDynamicMapServiceLayer$2.run(SourceFile:261) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) at java.util.concurrent.FutureTask.run(FutureTask.java:137) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) I started debugging to see what was going on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcGISDynamicMapServiceLayer.class, there is a method called InitLayer. Inside, we have this line:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MapServiceInfo var1 = this.serviceInfo != null ? (MapServiceInfo)this.serviceInfo : (new t(this.getUrl(), this.credentials)).a();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This line is where the exception is thrown. I go into the a() method, whatever it does. This is the method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public MapServiceInfo a() throws Exception { JsonParser var1 = h.a(this.serviceURL, (Map)null, this.getServiceCredentials()); MapServiceInfo var2 = MapServiceInfo.fromJson(var1, this.serviceURL); return var2; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the first line, it goes to this method:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public static final JsonParser a(String var0, Map&amp;lt;string, string=""&amp;gt; var1, n var2) throws Exception { return a(var0, (Map)var1, 1, var2); }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which call this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private static final JsonParser a(String var0, Map&amp;lt;string, string=""&amp;gt; var1, int var2, n var3) throws Exception { Object var4 = var1; JsonParser var5 = null; String var6 = a(var0, var3); try { HttpUriRequest var7 = null; AuthenticationType var15 = var3 != null &amp;amp;&amp;amp; var3.b != null ? var3.b.getAuthenticationType() : null; String var9; if (var15 == AuthenticationType.TOKEN &amp;amp;&amp;amp; !var0.contains("token=")) { var9 = a(var3); if (var9 != null) { if (var1 == null) { var4 = new HashMap(); } ((Map)var4).put("token", var9); } } else if (var15 == AuthenticationType.HTTP) { a(var0, var3.b); } var7 = c.a(var6, a((Map)var4), c(var3), false); var9 = (String)f.execute(var7, new BasicResponseHandler() { public String handleResponse(HttpResponse hresponse) throws IOException, HttpResponseException { c.a(hresponse); //EXCEPTION THROWN HERE return EntityUtils.toString(hresponse.getEntity(), "UTF-8"); } }); var5 = d.c(var9); var5.nextToken(); EsriSecurityException[] var10 = new EsriSecurityException[1]; String var11 = c.a(var9, var5, var6, var10, var2, var3); if (var11 != null) { return a(var11, (Map)var4, var2 + 1, var3); } if (var10[0] != null) { throw var10[0]; } } catch (SSLException var12) { throw new EsriSecurityException(-10004, "Untrusted server certificate from " + var6, var12); } catch (HttpResponseException var13) { if (var13.getMessage().contains("Unauthorized")) { throw new EsriSecurityException(-10001, "Invalid or missing user credentials", var13); } throw var13; } catch (EsriServiceException var14) { if (var14.getCode() == 401 || var14.getMessage().trim().contains("Unauthorized")) { throw new EsriSecurityException(-10001, "Invalid or missing user credentials", var14); } if (var14.getCode() != 302 &amp;amp;&amp;amp; var14.getCode() != 301) { throw var14; } String var8 = var14.getMessage(); var5 = a(var8, (Map)null, 1, var3); } return var5; } The exception is thrown in c.a(httpresponse) method, which is like this: static final void a(HttpResponse var0) { StatusLine var1 = var0.getStatusLine(); if (var1.getStatusCode() &amp;lt; 400 &amp;amp;&amp;amp; var0.getEntity() != null) { if (var1.getStatusCode() == 302 || var1.getStatusCode() == 301) { String var2 = var1.getReasonPhrase(); if (!var2.contains("?")) { Header var3 = var0.getFirstHeader("Location"); if (var3 != null) { var2 = var3.getValue(); } } throw new EsriServiceException(var1.getStatusCode(), var2); } } else { throw new EsriServiceException(var1.getStatusCode(), var1.getReasonPhrase()); } }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It fails to pass the first if statement, so it goes to the else, which is throwing a 503 code. Is there something I could do here? Is a server error?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(For clearer reading, see here: &lt;A class="link-titled" href="https://gis.stackexchange.com/questions/301537/503-error-showing-arcgisdynamicmapservicelayer" title="https://gis.stackexchange.com/questions/301537/503-error-showing-arcgisdynamicmapservicelayer"&gt;arcgis 10.2 - 503 error showing ArcGISDynamicMapServiceLayer - Geographic Information Systems Stack Exchange&lt;/A&gt; )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Nov 2018 10:02:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/503-error-using-arcgisdynamicmapservicelayer/m-p/701408#M4918</guid>
      <dc:creator>DavidFernández_Arias</dc:creator>
      <dc:date>2018-11-06T10:02:43Z</dc:date>
    </item>
  </channel>
</rss>

