AnsweredAssumed Answered

How to check if web service is returning data?

Question asked by dinali@ers.usda.gov on Feb 19, 2014
Latest reply on Mar 11, 2014 by testdeveloper
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:

  NSURL *mapUrl4 = [NSURL URLWithString:@"http://gis.ers.usda.gov/arcgis/rest/services/foodaccess/MapServer"];
   
  dynamicLyr4 = [AGSDynamicMapServiceLayer dynamicMapServiceLayerWithURL:mapUrl4];

  [self.mapView addMapLayer:dynamicLyr4 withName:@"Food Access"];

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?

Thanks for your help.

Outcomes