none
Error when trying to make Geocode Request, help needed

    Question

  • I am trying to make a Geocode request, and I followed the sample code in the SDK documentation, but it throws an exception on this line:

    GeocodeServiceClient geocodeService = new GeocodeServiceClient();

    The error message is: "An endpoint configuration section for contract 'GeocodeService.IGeocodeService' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name."

    Any idea how to fix this?  Thanks in advance.
    Wednesday, December 30, 2009 4:21 AM

Answers

  • GeocodeServiceClient client = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");

    It makes no difference to the end user which endpoint is bound. Supposedly there is a difference in how the request is sent, but I haven't looked into it yet.
    • Marked as answer by Sounge_old Saturday, January 02, 2010 1:46 AM
    Wednesday, December 30, 2009 3:16 PM

All replies

  • I did some searching on the Internet, and found this:

    http://blogs.msdn.com/nikolad/archive/2008/08/27/troubleshooting-an-endpoint-configuration-section-for-contract-could-not-be-loaded-because-more-than-one-endpoint-configuration-for-that-contract-was-found-error.aspx

    I put in one of the binding names into the GeocodeServiceClient constructor as the endpoint name, and it worked.  I am not sure if this is the proper solution, so if it isn't, please let me know.

    Also, what does this exactly do? I mean, putting in the binding name...
    Wednesday, December 30, 2009 4:33 AM
  • GeocodeServiceClient client = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");

    It makes no difference to the end user which endpoint is bound. Supposedly there is a difference in how the request is sent, but I haven't looked into it yet.
    • Marked as answer by Sounge_old Saturday, January 02, 2010 1:46 AM
    Wednesday, December 30, 2009 3:16 PM
  • <3
    Friday, June 11, 2010 3:45 PM
  • when I instantiated the class as your proposal GeocodeServiceClient client = new GeocodeServiceClient("BasicHttpBinding_IGeocodeService");

    nothing appears on the emulator!

    I do not know where the problem!
    Friday, April 08, 2011 9:12 PM
  • MS needs to update the documentation with this and let everyone know the sample is .NET 4.0+
    Monday, April 02, 2012 5:40 PM