We help IT Professionals succeed at work.

Problems after updating service reference

johnnyg123 asked
I have been working with a vs 2008 solution that contains a service reference.
(I have to admit this is my first attempt to work with vs 2008)

All was fine until I changed the location of the web service (to local host) so that I could debug it

Now when I try to debug and try to execute the following

 FSM_Webservice.VehicleInfoSoapClient oVehWs = new FSM_Webservice.VehicleInfoSoapClient();

I get the dreaded

An endpoint configuration section for contract 'FSM_Webservice.VehicleInfoSoap' could not be loaded because more than one endpoint configuration for that contact was found.  Please indicate the preferred endpoint configuration section by name.

Not sure what his means or how to resolve this error

Watch Question

do the following

1. Open app.config file and check the list of bindings for the service
2. Pick one binding and copy it to your source as a parameter to a constructor of Service Client class created by "Service Reference" dialog

please refer to the screen shot given for web config in my case

Now I was going to use HTTPS connection to the service and as such I am choosing to use "BasicHttpBinding_ICampaignManagementService" binding, which means modifying source code from:

svcCampMgt = new CampaignManagementServiceClient();
svcCampMgt = new CampaignManagementServiceClient("BasicHttpBinding_ICampaignManagementService");

This change fixes the problem.

Can you paste the code in the client app.config file?
have you updated the service reference in the client after you have modified the service configuration.

Thanks and regards,