koaltechs

Error on add feature in a feature layer

Discussion created by koaltechs on Feb 20, 2014
Latest reply on Mar 10, 2014 by njarecha-esristaff
We are trying to add a features to a feature service using the iOS SDK. The AGS service provides the following error on success callback:
If I inspect the returned AGSFeatureLayerEditResults I retrieve this JSON response:

{
   error =     {
       code = 209625216;
       description = "";
   };
   objectId = 0;
   success = 0;
}



The request of adding the feature has been implemented with the applyedits and addfeature. This is the code in used:
NSMutableDictionary *attributesDict = [[NSMutableDictionary alloc] init];
       NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
       [attributesDict setValue:@"-" forKey:@"fk_communitycode"];
       [attributesDict setValue:[defaults stringForKey:@"global_id"] forKey:@"fk_user_id"];
       [attributesDict setValue:_beach.name forKey:@"name"];
       [attributesDict setValue:[NSNumber numberWithInt:_beach.length.intValue] forKey:@"length"];
       //[attributesDict setValue:_beach.surveyLocation forKey:@"survey_location"];
       [attributesDict setValue:_beach.type forKey:@"beach_type"];
       [attributesDict setValue:_beach.location forKey:@"beach_location"];
       [attributesDict setValue:_beach.security forKey:@"security_info"];
       [attributesDict setValue:_beach.nationalCode forKey:@"national_reference"];
       [attributesDict setValue:_beach.url forKey:@"external_link"];
       
       AGSGraphic *beach = [AGSGraphic graphicWithGeometry:_geometry symbol:nil attributes:attributesDict];
       [_featureLayer applyEditsWithFeaturesToAdd:[NSArray arrayWithObject:beach] toUpdate:nil toDelete:nil];


When the request is posted directly on the ArcGIS Server Add Feature form on JSON, the response is successful and the feature is added (as follows).
[{
   "beach_location" = "Near river mouth";
   "beach_type" = Sandy;
   "fk_communitycode" = "-";
   "fk_user_id" = "{F8D35EAA-7118-4DAB-B6C0-A4F700A12668}";
   length = 96;
   name = Example;
}]


We will appreciate any help on this.

Thanks in advance

Outcomes