Set QueryParameters.MaxFeatures and catch a exception

1777
9
06-07-2017 06:08 PM
xiaoguangyan
New Contributor III

When I set QueryParameters.MaxFeatures then execute ServiceFeatureTable.QueryFeaturesAsync(QueryParameters parameters, QueryFeatureFields queryFeatureFields) then will catch a exception(Unable to complete operation.), but don't set it codes go well,I wonder if there is something to with the query when executed?

Tags (1)
0 Kudos
9 Replies
NagmaYasmin
Occasional Contributor III

Hi Yan,

The code works for the two services without any issue.  Could you try at your end as well:

Layer: States (ID: 2) 

Layer: Damage to Commercial Buildings (ID: 0) 

Thanks

Nagma

0 Kudos
ChadYoder1
Occasional Contributor II

I've seen this issue as well and it seems related to the backend system that is being used.

For example, the code worked when using on ArcGIS Online services, but when hitting client ArcGIS Server feature services, the error would occur.  Same data, same code, different environments.

Only difference I tracked as that the backend system of the client was Oracle.  Ended up having to just remove those parameters, but surely would be nice to figure out the issue.

The client services I access are private which is why I didn't purse it any further since I don't have data to share which can reproduce the issue.

0 Kudos
xiaoguangyan
New Contributor III

Hi Nagma

I notice in my service "Supports Pagination" and "Supports TrueCurve" are false, Is this matters?

0 Kudos
NagmaYasmin
Occasional Contributor III

Hi Yan,

For your service "SupportPagination" option needs to be true to execute the query successfully with the QueryParameters.MaxFeatures property. You could try to execute the same query with your service from the REST End point including the "Result Record Count" option. Since the pagination is false for your service, you will receive the error, "Pagination isn't supported". 

Here is the article for the pagination and REST API property

Error: Pagination is not supported 

ArcGIS REST API - Services and Data Types --> resultRecordCount

Hope that helps.

Nagma

0 Kudos
xiaoguangyan
New Contributor III

Hi Nagma

my service pagination is false, and don't has a "Result Record Count" option, only if pagination is true and then have the "Result Record Count" option

0 Kudos
xiaoguangyan
New Contributor III

only if pagination is true and then have the "Result Record Count" option?

0 Kudos
NagmaYasmin
Occasional Contributor III

Hi Yan,

I believe so, though I haven't tested any service that has "SupportPagination: false". According tot he REST API documentation, to get the result back from the two options, "resultOffset" and "resultrecordCount", pagination must be true.

Please look at thread below for further information about Pagination in case you need

How do you enable the "Supports Pagination" on a layer at 10.3? 

"underlying database determines whether pagination is supported. There isn't an advanced configuration setting that can be "enabled" to allow pagination. FileGDB is not supported at 10.3 but could be supported at a later release. Certain versions of enterprise geodatabases support pagination at 10.3."

Hope that helps. 

Nagma

0 Kudos
NagmaYasmin
Occasional Contributor III

Hi Yan

I just wanted to confirm that I tested with one of the service that has the "SupportPagination:false" and when I set the QueryParameters.Maxfeatures value it throws an exception. So to use the "MaxFeatures" in Runtime, you have to have the "SupportPagination" functionality of the service. Thanks

Nagma

0 Kudos
xiaoguangyan
New Contributor III

Hi, Nagma

Could you plz check my latest(singleinstance) asked question?

0 Kudos