1
votes

I have an application using Bing Maps API to retrieve coordinates for a postal code and then I perform spatial queries based on the result. There are times where I get empty results, but when I wait a few minutes it succeeds. I added logic that retried a handful of times if there's a failure but that doesn't seem to be helping. Here's the empty result I get back:

{"authenticationResultCode":"ValidCredentials","brandLogoUri":"http://dev.virtualearth.net/Branding/logo_powered_by.png","copyright":"Copyright © 2014 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","resourceSets":[{"estimatedTotal":0,"resources":[]}],"statusCode":200,"statusDescription":"OK","traceId":"7a6bfca3f89b4f94a4693a410da4feb7|CH10043840|02.00.107.2300|CH1SCH050102529"}

And here's the URL I'm calling:

http://dev.virtualearth.net/REST/v1/Locations?q=50613&o=json&key=MyApiKey

Is there a way I can retrieve further information based on the traceId? Or is this something that's just accepted when using Bing Maps API?

1

1 Answers

2
votes

You should firstly check the number of requests you're doing in a specific time and put it in relation with the type of Bing Maps Key you're using. Basic keys are rate limited which means that if you exceed the allowed number of request in a specific duration, you will be blocked.

Bing Maps Trial and basic key and rate limitation information

Those types of key are rate limited for security and logicial reasons (on 24h period and with time between the request) and that's the reason why you're getting a blank response without any information regarding the fact that it failed to geocode.

See the Terms of Use regarding the limitations and other restrictions (load and stress tests as well as hammering are part of it): http://www.microsoft.com/maps/product/terms.html

So, in order to try to analyze where your problem comes from, you might:

  • Check the type of key you're using and how many calls you're making on a specific period
  • Check the header of the response, it should include a specific header value: X-MS-BM-WS-INFO set to 1 if you are rate limited

See the MSDN about error handling: http://msdn.microsoft.com/en-us/library/ff701703.aspx

If you're not in this case (if you have an enterprise account), reach the technical support so they can officialy get back to you and check the key.