AnsweredAssumed Answered

local geodatabase changes  not visible in service when sync

Question asked by nrcnylmzz on Aug 29, 2018

Hello,

 

I am working on sync operations in runtime sdk for .net (version is 100.3.0.0).  I created a feature using the Sketch editor. I can send it to local geodatabase. I can see my features in my local geodatabase. Then I sync with the feature service and I did not get any errors. The  SyncGeodatabaseJob returned a successful result.
But I do not see any changes in feature service. There was no changes in my services. BTW, I am working on versioned data.

 

My code :

Generate geodatabase;

gdbSyncTask = await GeodatabaseSyncTask.CreateAsync(featureServiceUri);
Envelope dataExtent = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry as Envelope;
GenerateGeodatabaseParameters generateGdbParams = await gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(dataExtent);

generateGdbParams.OutSpatialReference = dataExtent.SpatialReference;
generateGdbParams.AttachmentSyncDirection = AttachmentSyncDirection.Bidirectional;

GenerateGeodatabaseParameters generateParams = await gdbSyncTask.CreateDefaultGenerateGeodatabaseParametersAsync(dataExtent);

GenerateGeodatabaseJob generateGdbJob = gdbSyncTask.GenerateGeodatabase(generateParams, "D:\\test.geodatabase");
generateGdbJob.Start();
geodatabase = await generateGdbJob.GetResultAsync();

 

Sync;

 

GeodatabaseSyncTask syncTask = await GeodatabaseSyncTask.CreateAsync(featureServiceUri);
SyncGeodatabaseParameters taskParameters = await syncTask.CreateDefaultSyncGeodatabaseParametersAsync(geodatabase);
taskParameters.GeodatabaseSyncDirection = SyncDirection.Bidirectional;
taskParameters.RollbackOnFailure = true;

// Get the ID for the layer.
long id = table.ServiceLayerId;
SyncLayerOption option = new SyncLayerOption(id);
taskParameters.LayerOptions.Add(option);

job.Start();
var result = await job.GetResultAsync();

 

 

Add feature;

 

table = geodatabase.GeodatabaseFeatureTable("X");

Feature newFeature = table.CreateFeature();
newFeature.Geometry = sketchOverlay.Graphics[0].Geometry;

newFeature.SetAttributeValue("x", "x");

await table.AddFeatureAsync(newFeature);

 

My service's capabilities:

 

What's wrong? Do I send parameters wrong?

Outcomes