Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 .NET WCF
im trying to consume a wcf service from a client application. Thw WCF services is hosted in web. After i add the service reference to the project, all the proxy gets generated.
 
when im tryin to access the proxy class methods., im gettin gthe below error:
 
An endpoint configuration section for contract 'XService.XServicePortType' could not be loaded because more than one endpoint configuration for that contract was found. Please indicate the preferred endpoint configuration section by name.
 
In app.config, i removed custom binding end points. I have just one http end point.
 
please suggest.
 
Thanks in advance.
Posted 6-Sep-12 1:39am
Comments
Sangramsingh Pawar at 6-Sep-12 7:40am
   
paste your config file
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Well, I think that the error message accurately describes the situation. The service exposes the contract on several endpoints.
Basically when creating the new client object, use the overloaded constructor (the one with the endpoint name). You fetch the name you want from the app.config.
  Permalink  
Comments
prince_arjun at 6-Sep-12 7:58am
   
I also tried using the overloaded operator like:
YourServiceClient service_obj = new YourServiceClient("EndPointName");,
still i get the same error above.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

try following
YourServiceClient service_obj = new  YourServiceClient("EndPointName");
  Permalink  
Comments
prince_arjun at 6-Sep-12 7:59am
   
I also tried using the overloaded operator like:
YourServiceClient service_obj = new YourServiceClient("EndPointName");,
still i get the same error above.
 
My config file:
xxxxxxx
Sangramsingh Pawar at 6-Sep-12 8:01am
   
if you paste here web.config file we will find some solution on it.
prince_arjun at 6-Sep-12 8:08am
   


abcd






This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150326.1 | Last Updated 6 Sep 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100