在ServiceModel客户端配置部分中找不到引用合约“IAuthenticationService”的默认端点元素 [英] Could not find default endpoint element that references contract 'IAuthenticationService' in the ServiceModel client configuration section

查看:139
本文介绍了在ServiceModel客户端配置部分中找不到引用合约“IAuthenticationService”的默认端点元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试创建一个简单的WCF应用程序,我没有更改任何现有的默认配置。我尝试使用 TestClient 使用 svcutil.exe 生成的服务。它显示错误消息在ServiceModel客户端配置部分中找不到引用合同IAuthenticationService的默认端点元素,这可能是因为没有为应用程序找到配置文件,或者因为没有端点元素匹配这个合同可以在客户端元素中找到。我尝试将端点设置为localhost:port number / test.svc,但它显示相同的错误。

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.

此代码在执行Web测试客户端后显示。我无法通过互联网搜索长时间后找出错误

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

这是我的testClients clientdll.config

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>


推荐答案

尝试删除那里的终点并使用

try removing the end points there and use

 compilation debug=true 

在web.config中。然后尝试

in web.config. then after trying

svcutil.exe http://your_wsdl

您将生成一个output.config。尝试使用output.config服务模型将服务模型节点替换为客户端网站或应用程序。它将工作

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

这篇关于在ServiceModel客户端配置部分中找不到引用合约“IAuthenticationService”的默认端点元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆