Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
avi_yach
Posts: 184
Registered: ‎11-26-2010
My Device: Not Specified

Bing map reverse Geocode REST API - HTTP 400 error - Bad Request

I had a requirement to replace Google reverse geo code api with Bing reverse geo code api due to company standards. When  I am trying to make HTTP Connection using the http://msdn.microsoft.com/en-us/library/ff701710.aspx  I am getting HTTP 400 error, Bad Request.

The link I am trying to establish connection is http://dev.virtualearth.net/REST/v1/Locations/13.010133000000000000,80.211216400000010000?o=xml&key=...

 

OS: 5.0+

 

Help of any sort is appreciated!!!

 

A Y. :smileyhappy:

Developer
maadani
Posts: 729
Registered: ‎05-04-2011
My Device: 9700

Re: Bing map reverse Geocode REST API - HTTP 400 error - Bad Request

[ Edited ]

Hi @avi_yach,

 

I suggest you do the following:

 

1. Check out the ErrorDetails in the response XML.

 

2. If you have the same problem when using a simulator, use a sniffer to compare the requests. Since the URL you posted works on browser, the problem can be in the http request (a missing/bad header, wrong content type, etc.).

If you can't reproduce the problem with a simulator, try connecting to your own local page just to see the request.

 

Hope that helps,

 

E.

Trusted Contributor
avi_yach
Posts: 184
Registered: ‎11-26-2010
My Device: Not Specified

Re: Bing map reverse Geocode REST API - HTTP 400 error - Bad Request

Thanks a lot for yur reply Erez, that helped me in understanding more. The problem is with my development environement. It doesn't allow me to connect to outside netowrk from my Simulator.

 

I will check in a live device or outside and will post here if I have any doubts.

 

Regards,

A Y.