AnsweredAssumed Answered

SOI not triggering AGS Server method "FeatureServer/uploads"

Question asked by jvseagle-co-nz-esridist Employee on Sep 4, 2016



I'm implementing an SOI to filter data based on a user/role profile. Everything has been supported and works well except the SynchronizeReplica method which has some dependencies with the uploads function. The ArcGIS for Server

SOI is not catching calls to the feature server uploads method which prevents me from having the ability to filter/sanitize the data being uploaded to the server.


Changes/deltas are passed to the synchronizereplica method in two ways:


1 - Through the "edits" property

2 - By referencing an uploaded replica id


Collector for ArcGIS uses the 2nd method currently.


The following requests are made to AGS Server in sequence:


POST http://(somedomain)/arcgis/rest/services/Editable/FeatureServer/uploads/register?f=json

POST http://(somedomain)/arcgis/rest/services/Editable/FeatureServer/uploads/i468639e9-41f2-4af8-bb8a-f8004ac2d6c3/uploadPart?token=SsiRSvSPcgwoWOZMQ1MyAa720ro1SiTRWiw4AKX-SprfnyGZEKyu2fRxdQ9py_0f4Ark7aYuh3LWsXBSZ3ZBmx5MkDym-__K3xxMJk-yJdal9Hyycyk-toWbrdb63_N8UJBEZMzgj4cpDqrouxVLBgX_55CKd-uTqZbgC0WkX-uIGRt7zZMDx3-7eePUYeWC&f=json


When all the replica parts have been uploaded to the server, Collector then issues the commit operation

POST http://(somedomain)/arcgis/rest/services/Editable/FeatureServer/uploads/i468639e9-41f2-4af8-bb8a-f8004ac2d6c3/commit


Once the commit has been finalized then Collector issues the SynchronizeReplica call to sync the deltas. This is the only method intercepted/known by the SOI not sure why.

POST http://(somedomain)/arcgis/rest/services/Editable/FeatureServer/synchronizeReplica


The SOI handler below does not intercept any of the calls to the feature server upload method

private RestHandlerOpCode GetHandlerOpCode(string resourceName, string operationName)


I need to be able of intercepting the 'uploads', so that I can handle the updates/deletes properly.


From my view there are only two options that I can think of:


1 - The SOI registers to listen to the 'uploads' event, which currently does not seem to support

2 - We have a way to connect to the replica using ArcObjects from within the synchronizereplica operation and manipulate the data. I know that I can reach the SQLite database from within this method but considering that the user can choose to use a file geodatabase or another format I don't see this as a suitable workaround.

Maybe there is a way of manipulating the data via ArcObjects? If so, can you share some sample code on how to do this?