[英]Could not find default endpoint element that references contract… But application still works
我目前正在使用其他项目来调用WebService的WPF应用程序。 当我尝试构建时,出现此错误:
找不到引用合同的默认端点元素
ServiceModel客户端配置部分中的“ VisitorRegistrationWebService.VisitorRegistrationWebServiceSoap”。 这可能是因为找不到您的应用程序的配置文件,或者是因为在客户端元素中找不到与该协定匹配的端点元素。
我的Webservice项目中的app.config与WPF项目中的app.config相同。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="VisitorRegistrationWebServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost/webservices/VisitorRegistrationWebService.asmx"
binding="basicHttpBinding" bindingConfiguration="VisitorRegistrationWebServiceSoap"
contract="BasicVisitorRegistrationWebService.VisitorRegistrationWebServiceSoap"
name="VisitorRegistrationWebServiceSoap" />
</client>
</system.serviceModel>
</configuration>
奇怪的是,我可以运行该项目并使用Web服务来获取数据,但是无论我清理并重建解决方案多少次,错误都不会消失。
在错误消息中,合同名称为“ VisitorRegistrationWebService.VisitorRegistrationWebServiceSoap”
并且在endPoint配置中,contract =“ BasicVisitorRegistrationWebService.VisitorRegistrationWebServiceSoap”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.