Discussion:
Help creating a windows service with Virtual Earth GeoCoding
(too old to reply)
Sekhar
2009-04-24 19:06:06 UTC
Permalink
I'm creating a class library to be used in a Windows Service to find GeoCode
for addresses in a database.

In the class library, I have references to
http://staging.mappoint.net/standard-30/mappoint.wsdl
https://staging.common.virtualearth.net/find-30/common.asmx

I was trying to implement the sample code from Virtual Earth SDK

GeocodeService.GeocodeRequest geocodeRequest = new
GeocodeService.GeocodeRequest();

// Set the credentials using a valid Virtual Earth token
geocodeRequest.Credentials = new GeocodeService.Credentials();
geocodeRequest.Credentials.Token = token;

// Set the full address query
geocodeRequest.Query = "1 Microsoft Way, Redmond, WA";

// Set the options to only return high confidence results
GeocodeService.ConfidenceFilter[] filters = new
GeocodeService.ConfidenceFilter[1];
filters[0] = new GeocodeService.ConfidenceFilter();
filters[0].MinimumConfidence = GeocodeService.Confidence.High;

GeocodeService.GeocodeOptions geocodeOptions = new
GeocodeService.GeocodeOptions();
geocodeOptions.Filters = filters;

geocodeRequest.Options = geocodeOptions;

// Make the geocode request
GeocodeService.GeocodeServiceClient geocodeService = new
GeocodeService.GeocodeServiceClient();
GeocodeService.GeocodeResponse geocodeResponse =
geocodeService.Geocode(geocodeRequest);

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

But, I can't seem to find the "GeocodeServiceClient" in the GeocodeService
namespace (everything else in the above code has no issues). It finds
GeoCodeService but not GeocodeServiceClient. Am I missing any other reference
I need in the project?

Can someone please help?

Thanks in advance.
--
Sekhar
Derek Chan
2009-04-27 00:49:01 UTC
Permalink
Sekhar,

That code snippit is coming from the Virtual Earth Web Services and not the
Mappoint Web Service. Adding a service reference to
http://staging.dev.virtualearth.net/webservices/v1/geocodeservice/geocodeservice.svc?wsdl will create the serviceclient references. See
http://msdn.microsoft.com/en-us/library/cc966738.aspx for more details.

Hope that helps,
--
Infusion Development
http://www.infusion.com
Post by Sekhar
I'm creating a class library to be used in a Windows Service to find GeoCode
for addresses in a database.
In the class library, I have references to
http://staging.mappoint.net/standard-30/mappoint.wsdl
https://staging.common.virtualearth.net/find-30/common.asmx
I was trying to implement the sample code from Virtual Earth SDK
GeocodeService.GeocodeRequest geocodeRequest = new
GeocodeService.GeocodeRequest();
// Set the credentials using a valid Virtual Earth token
geocodeRequest.Credentials = new GeocodeService.Credentials();
geocodeRequest.Credentials.Token = token;
// Set the full address query
geocodeRequest.Query = "1 Microsoft Way, Redmond, WA";
// Set the options to only return high confidence results
GeocodeService.ConfidenceFilter[] filters = new
GeocodeService.ConfidenceFilter[1];
filters[0] = new GeocodeService.ConfidenceFilter();
filters[0].MinimumConfidence = GeocodeService.Confidence.High;
GeocodeService.GeocodeOptions geocodeOptions = new
GeocodeService.GeocodeOptions();
geocodeOptions.Filters = filters;
geocodeRequest.Options = geocodeOptions;
// Make the geocode request
GeocodeService.GeocodeServiceClient geocodeService = new
GeocodeService.GeocodeServiceClient();
GeocodeService.GeocodeResponse geocodeResponse =
geocodeService.Geocode(geocodeRequest);
Results.Text = geocodeResponse.Results[0].DisplayName;
But, I can't seem to find the "GeocodeServiceClient" in the GeocodeService
namespace (everything else in the above code has no issues). It finds
GeoCodeService but not GeocodeServiceClient. Am I missing any other reference
I need in the project?
Can someone please help?
Thanks in advance.
--
Sekhar
Loading...