Click here to Skip to main content
12,826,440 members (23,642 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 C#
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 7-Dec-12 2:00am
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.
Krunal Rohit 7-Dec-12 8:49am
Delete your reference and App.Config file and try all process again..

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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 );

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
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