<?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 How to check if web service is returning data? in ArcGIS Runtime SDK for iOS Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-check-if-web-service-is-returning-data/m-p/757379#M6768</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a simple question. For an iOS app, I display several maps. Occasionally, a mapping service may not be available. Using the ESRI sample code, I'm passing the URL to the layer object like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; NSURL *mapUrl4 = [NSURL URLWithString:@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gis.ers.usda.gov/arcgis/rest/services/foodaccess/MapServer" rel="nofollow" target="_blank"&gt;http://gis.ers.usda.gov/arcgis/rest/services/foodaccess/MapServer&lt;/A&gt;&lt;SPAN&gt;"];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dynamicLyr4 = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:mapUrl4];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [self.mapView addMapLayer:dynamicLyr4 withName:@"Food Access"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears as though if the map service is not working, the code still returns a map layer, but it's empty. The code doesn't raise an exception. So my question is how should I be checking for cases where a service is down? Is there a specific property that I can check in the returned map layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Feb 2014 16:46:19 GMT</pubDate>
    <dc:creator>DinaLi</dc:creator>
    <dc:date>2014-02-19T16:46:19Z</dc:date>
    <item>
      <title>How to check if web service is returning data?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-check-if-web-service-is-returning-data/m-p/757379#M6768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This is a simple question. For an iOS app, I display several maps. Occasionally, a mapping service may not be available. Using the ESRI sample code, I'm passing the URL to the layer object like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; NSURL *mapUrl4 = [NSURL URLWithString:@"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://gis.ers.usda.gov/arcgis/rest/services/foodaccess/MapServer" rel="nofollow" target="_blank"&gt;http://gis.ers.usda.gov/arcgis/rest/services/foodaccess/MapServer&lt;/A&gt;&lt;SPAN&gt;"];&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; dynamicLyr4 = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:mapUrl4];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [self.mapView addMapLayer:dynamicLyr4 withName:@"Food Access"];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears as though if the map service is not working, the code still returns a map layer, but it's empty. The code doesn't raise an exception. So my question is how should I be checking for cases where a service is down? Is there a specific property that I can check in the returned map layer?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 16:46:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-check-if-web-service-is-returning-data/m-p/757379#M6768</guid>
      <dc:creator>DinaLi</dc:creator>
      <dc:date>2014-02-19T16:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to check if web service is returning data?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-check-if-web-service-is-returning-data/m-p/757380#M6769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can implement &lt;/SPAN&gt;&lt;PRE class="plain" name="code"&gt;- (void)layer:(AGSLayer *)layer didFailToLoadWithError:(NSError *)error { // Your error handler here }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; from the AGSLayer class to catch any errors in loading the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can see how it can be done in this example &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://developers.arcgis.com/os-x/sample-code/featurelayereditingsample/" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/os-x/sample-code/featurelayereditingsample/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2014 10:33:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-ios-questions/how-to-check-if-web-service-is-returning-data/m-p/757380#M6769</guid>
      <dc:creator>--2</dc:creator>
      <dc:date>2014-03-11T10:33:03Z</dc:date>
    </item>
  </channel>
</rss>

