AnsweredAssumed Answered

CreateReplica for a FeatureService on ArcGIS Online return nothing

Question asked by mtorresesri-co-esridist Employee on Jun 12, 2020

We are developing a Xamarin.Forms app that uses ArcGIS Runtime SDK for .NET to do offline editing.  To accomplish this task, a feature service was published to ArcGIS Online. Until the end of April the application downloaded the replicas without problem, but from that time the application gets stuck at 45% of the process (data reported by the SDK) and it is necessary to interrupt the download of the replica.

 

Reviewing, the download directory shows that the basemap is downloaded in .tpk or .vtpk format but the gdb with the feature service data does not. By doing a web-debugging it was possible to set that the SDK calls the createReplica function of the Rest Api, with the following parameters:

 

f

json

async

true

attachmentsSyncDirection

bidirectional

dataFormat

sqlite

geometry

{"xmin":-74.051215294838002,"ymin":4.6563683424734599,"xmax":-74.032975009746195,"ymax":4.6644197585674796}

geometryType

esriGeometryEnvelope

inSR

{"wkid":4326}

layerQueries

{"1":{"queryOption":"useFilter","useGeometry":true},"0":{"queryOption":"useFilter","useGeometry":true},"2":{"includeRelated":true,"queryOption":"none"},"3":{"includeRelated":true,"queryOption":"none"},"4":{"includeRelated":true,"queryOption":"none"},"5":{"includeRelated":true,"queryOption":"none"},"6":{"includeRelated":true,"queryOption":"none"},"7":{"includeRelated":true,"queryOption":"none"},"8":{"queryOption":"all"}}

layers

[1,0,2,3,4,5,6,7,8]

replicaOptions

{ "syncDataOptions": 1 }

replicaSR

{"wkid":102100,"latestWkid":3857}

returnAttachments

true

syncModel

perLayer

transportType

esriTransportTypeUrl

 

These are the HTTP request and response messages in raw format:

 

POST https://services1.arcgis.com/7S16A7PAFcmSmqJA/arcgis/rest/services/InspeccionPublica_WFL1/FeatureServer/createReplica HTTP/1.1

Referer: http://31e6402e-0407-4419-a6c3-7c6d18576017mm77914cpbf52/

Accept-Encoding: gzip, deflate

User-Agent: ArcGISRuntime-NET/100.8 (Windows 10.0.17763; Win64; WOW64; UAP; Windows.Desktop) 31e6402e-0407-4419-a6c3-7c6d18576017/1.0.0

Content-Length: 1225

Content-Type: application/x-www-form-urlencoded

Host: services1.arcgis.com

Connection: Keep-Alive

Cache-Control: no-cache

 

f=json&async=true&attachmentsSyncDirection=bidirectional&dataFormat=sqlite&geometry=%7B%22xmin%22%3A-74.051215294838002%2C%22ymin%22%3A4.6563683424734599%2C%22xmax%22%3A-74.032975009746195%2C%22ymax%22%3A4.6644197585674796%7D&geometryType=esriGeometryEnvelope&inSR=%7B%22wkid%22%3A4326%7D&layerQueries=%7B%221%22%3A%7B%22queryOption%22%3A%22useFilter%22%2C%22useGeometry%22%3Atrue%7D%2C%220%22%3A%7B%22queryOption%22%3A%22useFilter%22%2C%22useGeometry%22%3Atrue%7D%2C%222%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%223%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%224%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%225%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%226%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%227%22%3A%7B%22includeRelated%22%3Atrue%2C%22queryOption%22%3A%22none%22%7D%2C%228%22%3A%7B%22queryOption%22%3A%22all%22%7D%7D&layers=%5B1%2C0%2C2%2C3%2C4%2C5%2C6%2C7%2C8%5D&replicaOptions=%7B+%22syncDataOptions%22%3A+1+%7D&replicaSR=%7B%22wkid%22%3A102100%2C%22latestWkid%22%3A3857%7D&returnAttachments=true&syncModel=perLayer&transportType=esriTransportTypeUrl

 

HTTP/1.1 200 OK

Content-Type: text/plain; charset=utf-8

Content-Length: 161

Connection: keep-alive

Cache-Control: private, max-age=0, s-maxage=0

Server: Microsoft-IIS/10.0

X-ArcGIS-Correlation-Id: |a597c0a11d730b469748f272a747dc95.52de414d_

X-ArcGIS-Instance: MTSDS_Web_IN_20

X-Powered-By: ASP.NET

Access-Control-Allow-Origin: *

Date: Sun, 07 Jun 2020 07:03:15 GMT

X-Cache: Miss from cloudfront

Via: 1.1 8e7a7fa539063c32ccfe07b305af2b26.cloudfront.net (CloudFront)

X-Amz-Cf-Pop: BOG50-C1

X-Amz-Cf-Id: nd6Ocot4KGMAOB_Yzc4DP-ll8BHsq3WpfdKV97baXm3dAFv27ndnQQ==

 

{"statusUrl":"https://services1.arcgis.com/7S16A7PAFcmSmqJA/arcgis/rest/services/InspeccionPublica_WFL1/FeatureServer/jobs/d3bd63d0-6c51-41f5-ab10-d8c0a94b7d9d"}

 

 

The response in json format contains the url of the job that allow :  1) Monitor the progress and 2) Download the result. However, when checking the status of the replica over and over the body response is the same: Never finish and never shows result url:

 

Replica is created with the following data:

                        

{
  "replicaName" : "MyReplica_2726",
  "replicaID" : "6b2ee0ce-739d-48fe-82e4-bfa576f19fba",
  "replicaOwner" : "mctorres",
  "targetType" : "client",
  "layerServerGens" : [
    {
      "id" : 1,
      "serverGen" : 826592
    },
    {
      "id" : 0,
      "serverGen" : 826592
    },
    {
      "id" : 2,
      "serverGen" : 826592
    },
    {
      "id" : 3,
      "serverGen" : 826592
    },
    {
      "id" : 4,
      "serverGen" : 826592
    },
    {
      "id" : 5,
      "serverGen" : 826592
    },
    {
      "id" : 6,
      "serverGen" : 826592
    },
    {
      "id" : 7,
      "serverGen" : 826592
    },
    {
      "id" : 8,
      "serverGen" : 826592
    }
  ],
  "creationDate" : 1591513396000,
  "lastSyncDate" : 1591513396000,
  "syncModel" : "perLayer",
  "returnAttachments" : false,
  "spatialRel" : "Intersects",
  "geometry" : {
    "xmin" : -74.051215294838,
    "ymin" : 4.65636834247346,
    "xmax" : -74.0329750097462,
    "ymax" : 4.66441975856748,
    "spatialReference" : {
      "wkid" : 4326,
      "latestWkid" : 4326
    }
  },
 
  "layers" : [
    {
      "id" : 1,
      "queryOption" : "useFilter",
      "useGeometry" : true,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 0,
      "queryOption" : "useFilter",
      "useGeometry" : true,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 2,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 3,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 4,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 5,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 6,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 7,
      "queryOption" : "none",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    },
    {
      "id" : 8,
      "queryOption" : "all",
      "useGeometry" : false,
      "includeRelated" : true,
      "where" : ""
    }
  ],
  "spatialReference" : {
    "wkid" : 102100,
    "latestWkid" : 3857
  }
}

The data source for feature service publishing is a filegdb that has two layers and seven tables with relationships. These are the service data:

{
  "currentVersion" : 10.7,
  "serviceItemId" : "c93d8a2eb66049f789a8014cfb35c090",
  "serviceDescription" : "InspeccionPublica",
  "hasVersionedData" : false,
  "supportsDisconnectedEditing" : false,
  "hasStaticData" : false,
  "hasSharedDomains" : false,
  "maxRecordCount" : 2000,
  "supportedQueryFormats" : "JSON",
  "supportsVCSProjection" : false,
  "capabilities" : "Create,Delete,Query,Update,Editing,Sync",
  "description" : "",
  "copyrightText" : "",
  "spatialReference" : {
    "wkid" : 102100,
    "latestWkid" : 3857
  },
  "initialExtent" : {
    "xmin" : -8243343.5792444451,
    "ymin" : 518916.07693824446,
    "xmax" : -8241313.079996096,
    "ymax" : 519815.3295977416,
    "spatialReference" : {
      "wkid" : 102100,
      "latestWkid" : 3857
    }
  },
  "fullExtent" : {
    "xmin" : -8242629.4319193121,
    "ymin" : 519098.313887921,
    "xmax" : -8242083.9664079556,
    "ymax" : 519623.25095530582,
    "spatialReference" : {
      "wkid" : 102100,
      "latestWkid" : 3857
    }
  },
  "allowGeometryUpdates" : true,
  "units" : "esriMeters",
  "supportsAppend" : true,
  "supportsSharedDomains" : true,
  "size" : 540672,
  "syncEnabled" : true,
  "syncCapabilities" : {
    "supportsAsync" : true,
    "supportsRegisteringExistingData" : true,
    "supportsSyncDirectionControl" : true,
    "supportsPerLayerSync" : true,
    "supportsPerReplicaSync" : true,
    "supportsSyncModelNone" : true,
    "supportsRollbackOnFailure" : true,
    "supportsAttachmentsSyncDirection" : true
  },
  "supportsApplyEditsWithGlobalIds" : true,
  "supportsReturnDeleteResults" : true,
  "editorTrackingInfo" : {
    "enableEditorTracking" : false,
    "enableOwnershipAccessControl" : false,
    "allowOthersToQuery" : true,
    "allowOthersToUpdate" : true,
    "allowOthersToDelete" : false,
    "allowAnonymousToQuery" : true,
    "allowAnonymousToUpdate" : true,
    "allowAnonymousToDelete" : true
  },
  "xssPreventionInfo" : {
    "xssPreventionEnabled" : true,
    "xssPreventionRule" : "InputOnly",
    "xssInputRule" : "rejectInvalid"
  },
  "layers" : [
    {
      "id" : 0,
      "name" : "Lindero",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0,
      "geometryType" : "esriGeometryPolyline"
    },
    {
      "id" : 1,
      "name" : "Predio",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0,
      "geometryType" : "esriGeometryPolygon"
    }
  ],
  "tables" : [
    {
      "id" : 2,
      "name" : "Derecho",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 3,
      "name" : "Anexo del Derecho",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 4,
      "name" : "Interesado",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 5,
      "name" : "Anexo del Interesado",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 6,
      "name" : "Aprobación",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 7,
      "name" : "Aprobación Lindero",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    },
    {
      "id" : 8,
      "name" : "Predio Lindero",
      "parentLayerId" : -1,
      "defaultVisibility" : true,
      "subLayerIds" : null,
      "minScale" : 0,
      "maxScale" : 0
    }
  ]
}

Outcomes