ServiceFeatureTable.QueryFeaturesAsync inconsistent results on iOS

811
3
06-20-2018 04:27 PM
JeffSiemens
New Contributor II

I'm having some trouble with ServiceFeatureTable.QueryFeaturesAsync().

Basically, it seems to produce very inconsistent results on iOS. Sometimes it returns features, but mostly it doesn't. I've tried on a few different services and layers and get the same behavior.

My code looks like this:


var queryParams = new QueryParameters()
{
ReturnGeometry = true,
SpatialRelationship = SpatialRelationship.EnvelopeIntersects,

Geometry = // a polygon obtained from user in spatial ref wkid 3857 (web mercator)
};

var features = await featureTable.QueryFeaturesAsync(queryParams, Esri.ArcGISRuntime.Data.QueryFeatureFields.Minimum, options.CancellationToken);

The service is also in 3857.

The problem is that no features are returned even though there clearly are features at the given location. 


I looked at the request using the Charles web proxy (similar to Fiddler, but works on a Mac), and ArcGIS Server is responding with http 304 (not modified). If I repeat the request with caching disabled in Charles, then ArcGIS Server does return results to me.

It seems like a bug to me. Is this a known issue? Are there any workarounds or solutions?

It works fine on Android and Windows UWP.

0 Kudos
3 Replies
dotMorten_esri
Esri Notable Contributor

Our testing team just hit an almost identical issue and are looking into it.

0 Kudos
dotMorten_esri
Esri Notable Contributor

After some more testing, the issue the testing team found only affects the native iOS SDK, and does not affect Xamarin, so what you're hitting must be different.

Could you share all the headers from the request and responses you see in Charles for both the succeeding and the subsequent failing/cached requests? Perhaps that can help clue us in on what's going wrong.

0 Kudos
JeffSiemens
New Contributor II

Here are the headers for the request that fails (returns http 304):

POST /arcgis/rest/services/LA_StreetMap_DesignBase_Unsecured/MapServer/90/query HTTP/1.1
Host: mot-arcgis.latitudegeo.com:6080
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Connection: keep-alive
If-None-Match: 1402076183
Connection: keep-alive
Accept: */*
User-Agent: ArcGISRuntime-NET/100.2.1 (iOS 11.4; iPad5,3)
Referer: http://arcgis.com/
Content-Length: 4989
Accept-Language: en-ca

And here are the headers for a similar request in Windows that works (returns http 200):

POST /arcgis/rest/services/LA_StreetMap_DesignBase_Unsecured/MapServer/90/query HTTP/1.1
Referer: http://geocortexmobileviewerskg3azj8gvpd4/
Accept-Encoding: gzip, deflate
User-Agent: ArcGISRuntime-NET/100.2.1 (Windows 10.0.16299; x86; UAP; Windows.Desktop)
Content-Length: 4982
Content-Type: application/x-www-form-urlencoded
Host: mot-arcgis.latitudegeo.com:6080
Connection: Keep-Alive
Pragma: no-cache

If you'd like, I can also get you a Fiddler trace.

0 Kudos