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

Missing Bing EntityType enum value PointOfInterest #155

Open
ascott18 opened this issue Apr 26, 2022 · 3 comments
Open

Missing Bing EntityType enum value PointOfInterest #155

ascott18 opened this issue Apr 26, 2022 · 3 comments

Comments

@ascott18
Copy link

Geocoding.Microsoft.BingGeocodingException
  HResult=0x80131500
  Message=There was an error processing the geocoding request. See InnerException for more information.
  Source=Geocoding.Microsoft
  StackTrace:
   at Geocoding.Microsoft.BingMapsGeocoder.<GeocodeAsync>d__40.MoveNext()

  This exception was originally thrown at this call stack:
    System.Enum.TryParseByName(System.RuntimeType, System.ReadOnlySpan<char>, bool, bool, out ulong)
    System.Enum.TryParseInt32Enum(System.RuntimeType, System.ReadOnlySpan<char>, int, int, bool, bool, System.TypeCode, out int)
    System.Enum.TryParse(System.Type, System.ReadOnlySpan<char>, bool, bool, out object)
    System.Enum.TryParse(System.Type, string, bool, bool, out object)
    Geocoding.Microsoft.BingMapsGeocoder.ParseResponse(Geocoding.Microsoft.Json.Response)
    Geocoding.Microsoft.BingMapsGeocoder.GeocodeAsync(string)

Inner Exception 1:
ArgumentException: Requested value 'PointOfInterest' was not found.
@ascott18
Copy link
Author

Another one - GeoRegion

Geocoding.Microsoft.BingGeocodingException: There was an error processing the geocoding request. See InnerException for more information.
 ---> System.ArgumentException: Requested value 'GeoRegion' was not found.
   at System.Enum.TryParseByName(RuntimeType enumType, ReadOnlySpan`1 value, Boolean ignoreCase, Boolean throwOnFailure, UInt64& result)
   at System.Enum.TryParseInt32Enum(RuntimeType enumType, ReadOnlySpan`1 value, Int32 minInclusive, Int32 maxInclusive, Boolean ignoreCase, Boolean throwOnFailure, TypeCode type, Int32& result)
   at System.Enum.TryParse(Type enumType, ReadOnlySpan`1 value, Boolean ignoreCase, Boolean throwOnFailure, Object& result)
   at System.Enum.TryParse(Type enumType, String value, Boolean ignoreCase, Boolean throwOnFailure, Object& result)
   at Geocoding.Microsoft.BingMapsGeocoder.ParseResponse(Response response)
   at Geocoding.Microsoft.BingMapsGeocoder.GeocodeAsync(String address)
   --- End of inner exception stack trace ---
   at Geocoding.Microsoft.BingMapsGeocoder.GeocodeAsync(String address)
   at Geocoding.Microsoft.BingMapsGeocoder.Geocoding.IGeocoder.GeocodeAsync(String address)

@chatay
Copy link

chatay commented Jun 4, 2022

Hello @ascott18,
can you at least share your request payload and more information to be able to reproduce the issue.

@ascott18
Copy link
Author

ascott18 commented Jun 14, 2022

Unfortunately the request payload includes privileged customer data that I cannot share.

The issue here is quite straightforward - there are enum values that Bing will return that this library does not support.

PointOfInterest is defined here in the official bing SDK - https://github.com/microsoft/bing-search-sdk-for-net/blob/1fec1d7bb3776cca86db7b6fcd340e59db3d0d3c/sdk/EntitySearch/src/Generated/Models/EntityType.cs#L39. Note that the official SDK simply uses strings for these values, not enums, since the API could start returning new values at any time. GeoRegion seems to be so new that it doesn't even have a declared const in the official SDK. Sorry, I realized that the bing search SDK is not actually the bing maps SDK - there doesn't seem to be a bing maps SDK.

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