locked
"Could not find default endpoint element" error RRS feed

  • Question

  • User-178474816 posted

    Hi,

    I am creating a WCF in my MVC application to call the database but I keep getting this error which I cannot even debug,

    "Could not find default endpoint element that references contract 'HcmWcfService.IHcmDbCall' 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 web.config for the WCF does have the endpoint references so I am not sure what I could be missing. Any help would be greatly appreciated.

    <services>

          <service name="HCMWcfService.HcmDbCall" behaviorConfiguration="debug" >

            <endpoint address="" contract="HCMWcfService.IHcmDbCall" binding="basicHttpBinding"></endpoint>

            <endpoint address="mex" contract="IMetadataExchange" binding="mexHttpBinding" />

          </service>

             </services>

    Tuesday, July 22, 2014 11:21 AM

Answers

  • User-417640953 posted

    "Could not find default endpoint element that references contract 'HcmWcfService.IHcmDbCall' 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."

    Hi Souleymane,

    Thanks for your post.

    From your description, I see you integrated the wcf service in your mvc application, and your mvc application also as the client side of

    the wcf serive. And the error message above means you have not a servicemodel client endpoint in your web.config file like below.

    <client>
                        <endpoint address="http://localhost:2490/AuthenticationService.svc"
                            binding="basicHttpBinding"  contract="YourClientLibrary.IHcmDbCall">
                            <identity>
                                <dns value="localhost" />
                            </identity>
                        </endpoint>
    </client>
    

    Please check your web.config file.

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 23, 2014 2:00 AM

All replies

  • User-484054684 posted

    I think, you are calling your WCF service from some "client" say MVC application and that client's config file doesn't have your WCFService url.

    Tuesday, July 22, 2014 12:46 PM
  • User-178474816 posted

    I have the WCFService url in the client's config file. it gets put in there when you add a service reference in the client application.

    Tuesday, July 22, 2014 3:52 PM
  • User-417640953 posted

    "Could not find default endpoint element that references contract 'HcmWcfService.IHcmDbCall' 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."

    Hi Souleymane,

    Thanks for your post.

    From your description, I see you integrated the wcf service in your mvc application, and your mvc application also as the client side of

    the wcf serive. And the error message above means you have not a servicemodel client endpoint in your web.config file like below.

    <client>
                        <endpoint address="http://localhost:2490/AuthenticationService.svc"
                            binding="basicHttpBinding"  contract="YourClientLibrary.IHcmDbCall">
                            <identity>
                                <dns value="localhost" />
                            </identity>
                        </endpoint>
    </client>
    

    Please check your web.config file.

    Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 23, 2014 2:00 AM