question

Jerod-9332 avatar image
0 Votes"
Jerod-9332 asked IoTGirl answered

Where can I find further info on Unauthorized and TimeoutOccurred responses from Bing Maps REST Routing API?

The API request that is giving me troubles is
https://dev.virtualearth.net/REST/v1/Routes/Truck?key=X

We send with points in JSON format.
WPF App
Enterprise / Windows Application Keys

From time to time our customers are getting "Unauthorized" or "TimeoutOccurred" responses from Bing when we send off points to be routed with the above uri.

These errors are not consistent, a user could send off requests all day long and be ok, until it fails randomly. If it does fail, after some amount of time the request will go through successfully again. The data that we send with the request doesn't change, they just can wait for a bit, try again and it works. I've also checked their API keys every time and they are always valid.

I've read up on these errors but I don't even see "TimeoutOccurred" on this page.
https://docs.microsoft.com/en-us/bingmaps/rest-services/status-codes-and-error-handling

So can I get more info on these errors from Bing? Does Bing log these so we can query them or something (grasping at straws here I know). I just want to know why the request failed... sure a "TimeoutOccurred" or they are "Unauthorized", but how come sometimes that identical request will work fine just 5 mins later then?

Any help would be appreciated. I know I don't have many details but I can't replicate these random happenings so I can't get you any more details. Even an idea on how to proceed when I get these errors would be helpful. This stops our users dead in their tracks so telling them "wait a bit and try again" won't cut it.

windows-maps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

IoTGirl avatar image
1 Vote"
IoTGirl answered Jerod-9332 commented

Hi Jerod,

There are a number of issues that can cause a time out and the support team can work through these with you to get specifics (Microsoft.com/maps > Contact Us > Support > Enterprise Support) The two things they are going to ask you for are the Transaction Trace ID of the call and a wireshark trace of the call. As these are REST APIs they are are finding some folks are leaving ports open too long and a simple close and reopen can mitigate TimeOuts.

Sincerely,
IoTGirl


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you very much for the information IoTGirl! Marked as answer but have a couple of comments and questions...

  • I will work on logging the Transaction Trace Id when users hit these errors, that should be pretty straight forward.

  • I don't think wireshark will be do-able for us. We don't really have that kind of access to clients machines. I will certainly keep that in mind though and we can circle back to that if the Transaction Trace Id's are not enough.

  • Can you explain your last sentence a little further? Our users are firing REST API calls while they have a Bing Maps WPF Control open and they are using a SessionId from that control for all REST calls. Are you saying they could be hitting problems if they open that control and keep it open all day (or longer)? If that isn't right, I'm not sure how we or they (our users) could be leaving ports open.


0 Votes 0 ·
IoTGirl avatar image
1 Vote"
IoTGirl answered Jerod-9332 commented

Hi Jerod,

The session key has some limits as well. If you get "Unauthorized" then reloading the control and refreshing the session is probably what you need. The timeout can be a network timeout rather than an actual API call failure but you likely can't catch those without wireshark.

  • If you don't get a trace ID, then the call didn't make it to us and the failure ins in the network connection somewhere before it reaches Microsoft

  • If "retrying the call" means reloading the control that is probably what is fixing up your session

Sincerely,
IoTGirl

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We just did some reading on the sessionId time-limits and didn't find anything. I suppose we can try to refresh the control/sessionId every hour and I assume that would cover it. Not sure how to do that programmatically without interrupting our users. They open the control and drag and drop points to/from it all day long, feel free to give any info/ideas there but we can figure that out too I'm sure.

Great points on timeout issues.

I plan on adding logging for failed Transaction Trace Id's and once I get some of those coming back from users I'll talk to support like you said above (or will see if it even got to Bing).

Once again, thank you! This has been very helpful!

1 Vote 1 ·
IoTGirl avatar image
1 Vote"
IoTGirl answered

You could only refresh the control when the calls fails rather than hourly... :)

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.