First time using ArcgisRuntime in C#. I need to be able to query data from hosted feature layers from an internally hosted (enterprise) ArcGIS Portal. I'm using the Tutorial examples on ESRI's dev site. In this first method, I can navigate to the 'PortalItem' instance just fine; the attributes of this instance reflect what I see on the hosted layer page. Great. However, when I attempt to pass it into the FeatureLayer and call LoadAsync(), I get the JSON error:
"Invalid JSON: Range domain ranges only supports int16, int32, float32, float64, and DateTime values"
I also have the ChallengeHandler set, but it doesn't get called. I Suspect this is because the layer is set to 'Everyone'.
//Getting to the portal seems to work ust fine. ChallengeHandler is never called.
Uri portalUri = new Uri(@"https://gis.corp.com/portal");
Task<ArcGISPortal> portalTask = ArcGISPortal.CreateAsync(portalUri, true);
portalTask.Wait();
ArcGISPortal portal = portalTask.Result;
var info = portal.PortalInfo;
Task<PortalItem> itemTask = PortalItem.CreateAsync(portal, "1fb9cabe45ab4cd28a37066547b40c99");
itemTask.Wait();
PortalItem knownDevelopmentItem = itemTask.Result; //THIS WORKS - inspecting attributes, they match what I see in the webpage
FeatureLayer layer = new FeatureLayer(knownDevelopmentItem); //,0);
layer.LoadAsync().Wait(); //"Invalid JSON: Range domain ranges only supports int16, int32, float32, float64, and DateTime values"
//Also, just try to load feature table instead - same JSON error
FeatureTable ft = layer.FeatureTable;
ft.LoadAsync().Wait(); //"Invalid JSON: Range domain ranges only supports int16, int32, float32, float64, and DateTime values"
Here's the second, more simple attempt that shows the entire URL (which I believe to be accurate, but who knows at this point). Again, LoadAsync() throws the JSON exception.
//*** Method 2 - just pass in URL ***
String knownDevelopmentsURL = @"https://gis.corp.com/hosting/rest/services/Hosted/Known_Developments/FeatureServer/0";
FeatureLayer layer2 = new FeatureLayer(new Uri(knownDevelopmentsURL));
layer2.LoadAsync().Wait();
Any ideas on how to fix the JSON error?
EDIT: The entire JSON message is too long to post here, but here's the first bit of it:
{ "currentVersion": 10.81, "cimVersion": "2.6.0", "id": 0, "name": "Known Developments", "type": "Feature Layer", "parentLayer": null, "defaultVisibility": true, "minScale": 0, "maxScale": 0, "canScaleSymbols": false, "geometryType": "esriGeometryPolygon", "description": "", "copyrightText": "", "editFieldsInfo": { "creationDateField": "created_date", "creatorField": "created_user", "editDateField": "last_edited_date", "editorField": "last_edited_user" }, "syncCanReturnChanges": true, "relationships": [], "isDataVersioned": false, "isDataArchived": false, "isDataBranchVersioned": false, "isDataReplicaTracked": false, "isCoGoEnabled": false, "supportsRollbackOnFailureParameter": true, "supportsStatistics": true, "supportsAdvancedQueries": true, "supportsValidateSQL": true, "supportsCoordinatesQuantization": true, "supportsCalculate": true, "supportsASyncCalculate": true, "advancedQueryCapabilities": { "supportsReturningQueryExtent": true, "supportsStatistics": true, "supportsDistinct": true, "supportsPagination": true, "supportsOrderBy": true, "supportsQueryWithDistance": true, "supportsLod": true, "supportsPaginationOnAggregatedQueries": true, "supportsQueryWithResultType": true, "supportsCountDistinct": true, "supportsReturningGeometryCentroid": true, "supportsHavingClause": true, "supportsQueryWithLodSR": true, "supportsTopFeaturesQuery": true, "supportsOrderByOnlyOnLayerFields": false, "supportsPercentileStatistics": true, "supportsQueryAttachments": true, "supportsQueryAttachmentsWithReturnUrl": true, "supportsQueryWithDatumTransformation": true }, "extent": { "xmin": -1.3265363373E7, "ymin": 5839121.877800003, "xmax": -1.2880901900899999E7, "ymax": 6217740.999799997, "spatialReference": { "wkid": 102100, "latestWkid": 3857, "xyTolerance": 0.001, "zTolerance": 0.001, "mTolerance": 0.001, "falseX": -20037700, "falseY": -30241100, "xyUnits": 10000, "falseZ": -100000, "zUnits": 10000, "falseM": -100000, "mUnits": 10000 } },