Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find default endpoint element that references contract 'IAuthenticationService' in the ServiceModel client configuration section

I tried creating a simple WCF application, I haven't changed any of the existing default configurations. I have tried consuming the service using the TestClient generated by using svcutil.exe. It is showing an error message "Could not find default endpoint element that references contract 'IAuthenticationService' 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." I tried putting endpoint to localhost:port number/test.svc but its showing the same error.

this code is being shown after i execute the web test client. I couldnt trace out the error after searching for long hours over internet

Here is my testClients clientdll.config

<configuration>
    <system.serviceModel>
        <bindings>
            <wsHttpBinding>
                <binding name="wsHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00"
                    receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
                    transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                    allowCookies="false">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <reliableSession ordered="true" inactivityTimeout="00:10:00"
                        enabled="false" />
                    <security mode="Message">
                        <transport clientCredentialType="Windows" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="Windows" negotiateServiceCredential="true"
                            algorithmSuite="Default" establishSecurityContext="true" />
                    </security>
                </binding>
            </wsHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:2490/AuthenticationService.svc"
                binding="wsHttpBinding" bindingConfiguration="wsHttpBinding"
                contract="IAuthenicationService" name="wsHttpBinding">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
        </client>
    </system.serviceModel>
</configuration>
like image 568
Ranjith Kumar Nagiri Avatar asked Oct 29 '13 13:10

Ranjith Kumar Nagiri


2 Answers

try removing the end points there and use

 compilation debug=true 

in web.config. then after trying

svcutil.exe http://your_wsdl

you will generate an output.config. Try putting in servicemodel nodes replacing your client website or application with the output.config service model. It will work

like image 166
Shiva Saurabh Avatar answered Oct 23 '22 10:10

Shiva Saurabh


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.

The name of the binding or contract will be wrong. You confing needs to look something like

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="Binding1" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://foo" binding="basicHttpBinding" bindingConfiguration="Binding1" contract="Service.MyService" name="MyService" />
    </client>
  </system.serviceModel>

Make sure the bindingConfiguration matches the binding name. In the above example Binding1

like image 26
Sam Leach Avatar answered Oct 23 '22 11:10

Sam Leach