0

I am working add feature to feature service as offline. My feature service is editable. I created a geodatabase and added a feature to it. I can see my feature I added in geodatabase. However, when I synchronize geodatabase with feature service, I get a "" error. Error is not null just "";

The code is below ;

GeodatabaseSyncTask syncTask = await GeodatabaseSyncTask.CreateAsync(featureServiceUri);

// Create sync parameters
SyncGeodatabaseParameters taskParameters = await syncTask.CreateDefaultSyncGeodatabaseParametersAsync(geodatabase);

// Create a synchronize geodatabase job, pass in the parameters and the geodatabase
SyncGeodatabaseJob job = syncTask.SyncGeodatabase(taskParameters, geodatabase);



MessageBox.Show(job.Status.ToString());
job.Start();
MessageBox.Show(job.Status.ToString());

job.JobChanged += (s, arg) =>
{
    // Report changes in the job status
    if (job.Status == JobStatus.Succeeded)
    {
        // Report success ...
        MessageBox.Show("Synchronization is complete!");
    }
    else if (job.Status == JobStatus.Failed)
    {
        // Report failure ...
        MessageBox.Show(job.Error.Message);
    }
    else
    {
        // Report that the job is in progress ...
        MessageBox.Show("Sync in progress ...");
    }
};


// await the completion of the job
await job.GetResultAsync();

I get error at await job.GetResultAsyn(); line.

enter image description here

What am I doing wrong?

Henrik Wilshusen
  • 289
  • 1
  • 11
codeLover
  • 43
  • 1
  • 5

1 Answers1

0

I don't see anything wrong with the code you shared. I wonder if maybe you are hitting the same issue in this post.

Were you able to sync with other feature services? If you are able to monitor web traffic, the error JSON may contain details that are not populated in the ArcGISWebException but this has been logged and we'll try to get this fixed in future releases of the API.

jnery
  • 11
  • 1
  • Thank you for your answer. I am working on versioned data. This method is synchronizing on unversioned data. I tried unversioned data it works. How can I work on unversioned data. Maybe I made a mistake while adding feature to geodatabase. – codeLover Aug 28 '18 at 08:59