Fields in FeatureService all set to NULL

528
1
Jump to solution
07-16-2019 02:07 PM
AdamEryavec
New Contributor II

I am using the ArcGIS Runtime API for .NET to create a program which can add and remove features from the layers in a FeatureService created with ArcMap 10.5 and deployed to ArcGIS Server 10.5. The feature layers are created from shapefiles where I added additional fields with ArcCatalog 10.5.

The feature layers have 0 features in them when they are deployed.

I create a ServiceFeatureTable for each feature layer and call InitializeAsync(spatialref) and set the OutFields to all fields. I add features by creating a GeodatabaseFeature with the table schema, setting the values for the Attributes, calling ServiceFeatureTable.AddAsync(feature), and then calling ServiceFeatureTable.ApplyEditsAsync(). In some cases UpdateAsync(feature) is called after AddAsync(feature) to adjust certain fields, but the outcome is the same.

The features are added but the values of all the fields (besides the built-in OID and geometry fields) are NULL. The only way to prevent this is to access the geodatabase table through ArcCatalog after deploying the service and then immediately stopping it, and then setting Allow NULLS = No for each field for each feature layer. This workaround is error-prone as it is possible to miss one field, if anybody knows the root cause of this issue help would be greatly appreciated.

0 Kudos
1 Solution

Accepted Solutions
AdamEryavec
New Contributor II

This issue was resolved after re-installing ArcGIS server. Having all feature layers contain 0 features upon deployment may have contributed to the error.

View solution in original post

0 Kudos
1 Reply
AdamEryavec
New Contributor II

This issue was resolved after re-installing ArcGIS server. Having all feature layers contain 0 features upon deployment may have contributed to the error.

0 Kudos