-
Notifications
You must be signed in to change notification settings - Fork 29
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
AsRequestQueryString Limitation #10
Comments
Hi, can you give me a bit more information please. Which line is failing? There is a test which has a complex shape that gets auto converted to POST so I thought that scenario should work. Also, if you're able to send me the query being run I could test it out. Alternatively, if always running the operation as a POST would solve this for you you can do this by overriding the method in the gateway to invoke Post rather than Get e.g. public class ArcGISGateway : PortalGateway
{
public ArcGISGateway(string root, ITokenProvider tokenProvider)
: base(root, tokenProvider: tokenProvider)
{ }
public override Task<QueryResponse<T>> Query<T>(Query queryOptions, CancellationToken ct = default(CancellationToken))
{
return Post<QueryResponse<T>, Query>(queryOptions, ct);
} |
Thanks for the quick reply, Dave. Here is the calls stack I should have included. The hard limit in System.UriHelper.EscapeString method is 65k. There is a complex parcel in our of our clients that has so many vertices that it blows up. They actually have a number of such parcels. System.AggregateException: One or more errors occurred. ---> System.UriFormatException: Invalid URI: The Uri string is too long. at System.UriHelper.EscapeString(String input, Int32 start, Int32 end, Char[] dest, Int32& destPos, Boolean isUriString, Char force1, Char force2, Char rsvd) at System.Uri.EscapeDataString(String stringToEscape) at ArcGIS.ServiceModel.PortalGatewayBase.<>c__DisplayClass57_0 |
Looks like you're using an old version of the old version of this project as that method is no longer used. Are you able to update your reference? |
It is indeed old version. I do see the same code in this repo in PortalGatewasBase: - https://github.com/davetimmins/Anywhere.ArcGIS/blob/66d51dca984693e38cff97668d5f77f6371aea2c/src/Anywhere.ArcGIS/PortalGatewayBase.cs. I must be missing something. |
I had another look and it is still using |
I was able to reproduce this and using POST does work, so the initial workaround I suggested should work for you. I'll put in a fix so that it'll work if GET is tried too. |
Fixed in 1.2.0 |
Hello, Dave.
We found an issue with AsRequestQueryString. If we do a spatial query on a complex shape, it will bust 65k limit of EscapeString in .NET Framework. Unfortunately, it switches to POST based on the serialized value, but it can never get that length based on this exception.
Do you have any suggestions or a fix?
Thank you.
The text was updated successfully, but these errors were encountered: