none
reverse geocoding with windows mobile 6 RRS feed

  • Question

  • Hi,

    i want to get the address of a location using bing map services, i'm using visual studio 2008 and windows mobile sdk 6 here is what i do

    i add the reference http://dev.virtualearth.net/webservices/v1/metadata/geocodeservice/geocodeservice.wsdl 

    then i use this code  

    ...

    using mynamespace.VEGeocodeService;

     

    public partial class Accueil : Form
     

    {   ......

    public

    GeocodeService geocodeService;

     

    string ApplicationKey = "my key";

     

    ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();

    ....

    }

     private void Accueil_Load(object sender, EventArgs e)

    {

     

    reverseGeocodeRequest.Credentials =

    new Credentials

    ();

    reverseGeocodeRequest.Credentials.ApplicationId = ApplicationKey;

     Location loc = loc.latitude = 47;

     

     

    loc.Longitude = 5;

    reverseGeocodeRequest.Location= loc;

    

    geocodeService =new GeocodeService();

     

    GeocodeResponse geocodeResponse = geocodeService.ReverseGeocode(reverseGeocodeRequest);

     

    if (geocodeResponse.Results.Length > 0)

    {

    label3.Text = geocodeResponse.Results[0].DisplayName;

    }

     

    else

    label3.Text ="No Results found" ;

    geocodeService.Dispose();

    }

    ...

    

    when i start my problem i ge this error "Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'."

    please any help is appreciated :)

     

     

     

     

    • Edited by hssouna19 Wednesday, June 15, 2011 12:53 AM
    • Moved by Ricky_Brundritt Friday, March 9, 2012 6:12 PM (From:Bing Maps: Map Control and Web services Development)
    Friday, June 10, 2011 4:06 PM

Answers

  • If you are using the service on a mobile phone, I recommend to use REST Web Service as its responses and requests are lighter than the SOAP Web Service's ones.

    But in your case, I suspect that you have an error associated to a bad encoding that is caused by your proxy classes.
    You should take a look at your proxy classes in order to see if you can set the content type while retrieving or requesting information from the service.


    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/
    Monday, June 13, 2011 9:20 AM
    Moderator
  • I ran into this issue a long time ago when the SOAP services were first released. I wrote an article on using the SOAP services for Mobile and in the end I created a separate web service that accessed the SOAP services because it was a pain to work with and resulted in a lot more data being loaded into the phone than needed. As Nicolas mentioned, the REST services is the recommended way to go. These were created with mobile in mind and are easier to use and have more features that the SOAP services. Here is the article I wrote on the SOAP services and mobile a while back (before the REST services existed): http://msdn.microsoft.com/en-us/library/dd483215.aspx
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Saturday, June 18, 2011 12:15 PM

All replies

  • If you are using the service on a mobile phone, I recommend to use REST Web Service as its responses and requests are lighter than the SOAP Web Service's ones.

    But in your case, I suspect that you have an error associated to a bad encoding that is caused by your proxy classes.
    You should take a look at your proxy classes in order to see if you can set the content type while retrieving or requesting information from the service.


    MVP - Bing Maps - My blog (FR): http://blogs.developpeur.org/nicoboo/ Twitter: http://twitter.com/nicolasboonaert/
    Monday, June 13, 2011 9:20 AM
    Moderator
  • thanks for replying.

    Wednesday, June 15, 2011 12:51 AM
  • I ran into this issue a long time ago when the SOAP services were first released. I wrote an article on using the SOAP services for Mobile and in the end I created a separate web service that accessed the SOAP services because it was a pain to work with and resulted in a lot more data being loaded into the phone than needed. As Nicolas mentioned, the REST services is the recommended way to go. These were created with mobile in mind and are easier to use and have more features that the SOAP services. Here is the article I wrote on the SOAP services and mobile a while back (before the REST services existed): http://msdn.microsoft.com/en-us/library/dd483215.aspx
    Windows Live Developer MVP - http://rbrundritt.wordpress.com | http://inknowledge.co.uk
    Saturday, June 18, 2011 12:15 PM