Environment:
- ArcGIS Runtime for .NET 10.2.7
- ArcGIS Server 10.3.1
- Map Service with Feature Access enabled (Create, Read, Update)
Postgres database underneath
ServiceFeatureTable reportLayer = await ServiceFeatureTable.OpenAsync(new Uri("http://localhost/arcgis/rest/services/MyMapService/FeatureServer/4")); var testFeature = reportLayer.CreateNew(); //new GeodatabaseFeature(reportLayer.Schema); testFeature.Attributes["a_commodity_group"] = "fake"; var addedReportOIDs = await reportLayer.AddAsync(testFeature); var editResult = await reportLayer.ApplyEditsAsync();
I've done the CreateNew() as well as creating a new GeodatabaseFeature as described in the documents here:
I've tried Adding and Updating features. The "a_commodity_group" attribute is exactly how I see it spelled in the rest endpoint and is a Text/varchar field in the database underneath
I'm seeing none of my attributes come through. (example, the "fake" value that I've put in here)
ArcGIS Server Log (at "Info" level)
FINE Mar 28, 2016, 8:59:46 PM GraphicFeatureServer::HandleRESTRequest
inputJSON = {"rollbackOnFailure":true,"adds":[{"attributes":{"objectid":-10}}]}
Inspecting client traffic from Telerik's Fiddler:
As you can see, the request is totally wrong in that it doesn't have any other attributes going in.
Manually adding features through "ApplyEdits" in the REST endpoint worked.
Info from ArcGIS Server logs (the attributes come in correctly here):
GraphicFeatureServer::HandleRESTRequest ## inputJSON = {"adds":[{"attributes":{"objectid":405,"a_commodity_group":"fake"}}],"rollbackOnFailure":true}
I don't see any known issues with this in the ArcGIS Runtime. I'm considering writing my own REST api as the workaround right now since I can't get this to work.
It's quite possible that I'm making a totally wrong assumption in how I'm using the API, but I haven't seen many examples for adding features to a connected service. I'll double check the full .net runtime sdk pdf document and see if I'm doing anything wrong, too.
Update:
I also noticed that DeleteAsync
doesn't work unless I layer.QueryAsync
the features first. Probably has something to do with some local cache in the ServiceFeatureTable
layer object. Before I was querying objectids using the ExecuteObjectIdsQueryAsync()
method on a QueryTask
object.