Wednesday, September 1, 2010

Could not find default endpoint

This was a weird error I got while trying to consume a WCF service in my web application.
Could not find default endpoint element that references contract 'WS_User.IUser' 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.


My project setup was so that the service reference was made in a class library whose method, user authentication, was invoked by the web application. So the solution to this problem was that I had to have the binding information at two places:
a.) The class library that was making the call to WCF service, and
b.) The web application that was making a call to the method in class library.

A bit weird behavior in my view, but that did away with the issue.

No comments: