Skip to main content

Command Palette

Search for a command to run...

Error : Could not find default endpoint element

Published
1 min read
Error : Could not find default endpoint element
F

Performance freak

Error :

Could not find default endpoint element that references contract 'XXX.xxx' 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.

This error can arise if you are calling the service in a class library and calling the class library from another project.

If you are using web app, then you have to copy app.config of class library configuration content to web.config of web project.

Here is the config details. It contains bindings and client nodes.

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="smsnnPortBinding" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://api.google.com/SMS"
            binding="basicHttpBinding" bindingConfiguration="smsnnPortBinding"
            contract="XXX.xxx" name="smsnnPort" />
    </client>
  </system.serviceModel>

Be careful, contract="XXX.xxx" name must be same as error indicated

More from this blog

A developer's diary

45 posts

Just developer