[英]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. 我尝试创建一个简单的WCF应用程序,我没有更改任何现有的默认配置。 I have tried consuming the service using the
TestClient
generated by using svcutil.exe
. 我尝试使用使用
svcutil.exe
生成的TestClient
来使用该服务。 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."
它
"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."
显示错误消息"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. 我尝试将端点放到localhost:端口号/ test.svc,但它显示相同的错误。
this code is being shown after i execute the web test client. 我执行Web测试客户端后显示此代码。 I couldnt trace out the error after searching for long hours over internet
在网上搜索了很长时间之后,我无法找出错误
Here is my testClients clientdll.config 这是我的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
in web.config. 在web.config中。 then after trying
然后尝试
svcutil.exe http://your_wsdl
you will generate an output.config. 你将生成一个output.config。 Try putting in servicemodel nodes replacing your client website or application with the output.config service model.
尝试使用output.config服务模型将servicemodel节点替换为客户端网站或应用程序。 It will work
它会工作
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
. 确保
bindingConfiguration
与binding name
匹配。 In the above example Binding1
在上面的示例
Binding1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.