Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with BatchQuery #31

Closed
mgayheart1 opened this issue Jul 23, 2018 · 1 comment
Closed

Problems with BatchQuery #31

mgayheart1 opened this issue Jul 23, 2018 · 1 comment

Comments

@mgayheart1
Copy link
Contributor

I found two issues when testing BatchQuery using Azure Functions 1.x against an AGOL Hosted Feature Service:

  1. I get an error like this:

"message": "Exception while executing function: -> Nullable object must have a value.",
"errorDetails": "Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: ---> System.InvalidOperationException : Nullable object must have a value.\r\n at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)\r\n at async Anywhere.ArcGIS.PortalGatewayBase.BatchQuery[T](Query queryOptions,CancellationToken ct)\r\n
..."

I was able to fix this by changing PortalGatewayBase line 242 from:

exceeded = result.ExceededTransferLimit.HasValue && innerResult.ExceededTransferLimit.Value;

to

exceeded = result.ExceededTransferLimit.HasValue && innerResult.ExceededTransferLimit.HasValue && innerResult.ExceededTransferLimit.Value;
  1. I wasn't actually getting back all the results from the feature service. I was expecting 5000+ features, but I was only getting the results from the first query. I was able to fix this by changing PortalGatewayBase line 241 from:
result.Features.ToList().AddRange(innerResult.Features);

to

result.Features = result.Features.Concat<Feature<T>>(innerResult.Features);

I didn't have time to test against various types of AGS services so it is possible that these changes were unique to my setup, but wanted to send them along just in case.

Thanks for sharing this great repo!

davetimmins added a commit that referenced this issue Jul 24, 2018
@davetimmins
Copy link
Owner

Yea those changes seem to work, I've pushed them to the dev branch so the myget package (1.6.1-dev59) has them if you wanted to test it out.

mgayheart1 added a commit to mgayheart1/Anywhere.ArcGIS that referenced this issue Aug 1, 2018
BatchQuery method that supports both services that handle pagination and those that don't.
davetimmins added a commit that referenced this issue Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants