Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi friends .......

i am getting a problem while calling a method on WCF service.
Some time this method is running properly.
but some time it shows following exception:-


Could not find default endpoint element that references contract 'UpdationWebService.IService1' in the ServiceModel client configuration section.
This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.



In this UpdationWebService is web service name (WCF).

I am not getting why it is throwing this exception,........
sometimes it is running properly...
, sometime it is causing Problem...

please help me ......., it's urgent
Posted
Comments
helloworld2020 7-Dec-12 7:23am    
Check your endpoint in configuration file of client. Make sure that everything is correct. Or post your both client and service configuration code, and we can see exactly. Be sure that your service is already in run.
[no name] 7-Dec-12 8:49am    
Delete your reference and App.Config file and try all process again..

1 solution

Hi thanks to all for their valuable replies..


Every one suggestions, To check appconfig. was good. I checked, but still it was showing same problem. I solved it by providing Binding to httpBinding and endPointAddress to my ServiceRefrence

as follows

BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress endPointAddress = new EndpointAddress("http://LocalHos/Service1.svc");

ServiceClient sv = new ServiceClient(binding ,endPointAddress );
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900