SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm getting an error from a web part that calls a web service. I think I just need to add the endpoint XML to the web.config. Is there a better way to do this? Can I add the endpoint from Central Admin, or is there a way to set the web service address using a web part property?

Error - Could not find default endpoint element that references contract 'ABC.XYZ' 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.

share|improve this question
Are you sure your web service works? – Kit Menke Nov 28 '12 at 20:02
Yes, I've tested the service with WCFTestClient – NoBot Nov 29 '12 at 0:26
up vote 0 down vote accepted

I have never tried it, but I have run into posts claiming this may work:

share|improve this answer
Thanks for the link. I'll give this a try. – NoBot Nov 29 '12 at 0:47
This worked for me. Thanks! – NoBot Dec 3 '12 at 20:31

The dynamic configuration of your service in SharePoint comes in the form of a custom service factory. When you develop your service, you must specify the service factory provided by SharePoint, and after you specify it, you no longer need configuration entries in web.config. See this post for more details.

share|improve this answer
The service I am using is not hosted on the SharePoint server. So if I understand the post correctly, I don't think it's applicable for my current need. Thank you! – NoBot Nov 29 '12 at 0:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.