i am using the following service reference to get location details from latitude and longnitude
http://dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc
i added the above URL to my Service reference class and try to get the location details by calling the below method
public void reverse()
{
string Results = "";
try
{
// Set a Bing Maps key before making a request
string key = "Bing Maps Key";
ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();
// Set the credentials using a valid Bing Maps key
reverseGeocodeRequest.Credentials = new GeoCodeService.Credentials();
reverseGeocodeRequest.Credentials.ApplicationId = key;
// Set the point to use to find a matching address
GeoCodeService.Location point = new GeoCodeService.Location();
point.Latitude = 47.608;
point.Longitude = -122.337;
reverseGeocodeRequest.Location = point;
// Make the reverse geocode request
GeocodeServiceClient geocodeService = new GeocodeServiceClient();
**GeocodeResponse geocodeResponse = geocodeService.ReverseGeocode(reverseGeocodeRequest);**
}
catch (Exception ex)
{
Results = "An exception occurred: " + ex.Message;
}
but i am getting the following error message
GeoCodeService.GeoCodeServiceClient does not contain a definition for ReverseGeocode and no extension method
GeoCodeService.GeoCodeServiceClient could not be found.
help me in solving the problem.and also tell me is this a best way to find location details .
In Windows Phone 8 you have built-in API for reverse geocoding, without the need of adding a Service Reference to Bing Maps: