Jul 192012
Using wpf: Credentials Doesn’t Exist? on newest questions tagged wpf – Stack Overflow
I’m messing about with the Bing Maps WPF control and SOAP services, trying to reverse geocode a point. I tried to implement some code from this project, specifically this block of code:
private string ReverseGeocodePoint(string locationString)
{
string results = "";
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();
string[] digits = locationString.Split(';');
point.Latitude = double.Parse(digits[0].Trim());
point.Longitude = double.Parse(digits[1].Trim());
reverseGeocodeRequest.Location = point;
// Make the reverse geocode request
GeocodeServiceClient geocodeService = new GeocodeServiceClient();
GeocodeResponse geocodeResponse = geocodeService.ReverseGeocode(reverseGeocodeRequest);
if (geocodeResponse.Results.Length > 0)
results = geocodeResponse.Results[0].DisplayName;
else
results = "No Results found";
return results;
}
However, when I try to implement it, I’m being told: Error: The type or namespace name 'Credentials' does not exist in the namespace 'GeocodeTest.GeocodeService' (are you missing an assembly reference?) This error occurs on the line:
reverseGeocodeRequest.Credentials = new GeocodeService.Credentials();
Did I forgot a reference somewhere? Am I doing something incorrectly?
See Answers
source: http://stackoverflow.com/questions/11569025/credentials-doesnt-exist
Using wpf: using-wpf
Recent Comments