找不到引用合同的默认端点元素
我的是windows应用程序。我正在使用网络服务。当我向应用程序添加服务引用时,它会生成一个 app.config 文件。
<client>
<endpoint address="http://58.71.131.223/uucpapi/UUCPAPIServer.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUUCPAPIServer"
contract="UUCPAPI.IUUCPAPIServer" name="WSHttpBinding_IUUCPAPIServer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
我正在调用这个 API,因为
UUCPAPI.UUCPAPIServerClient uucp = new UUCPAPI.UUCPAPIServerClient();
它在这里抛出异常
找不到引用合约的默认端点元素
ServiceModel
客户端配置部分中的“UUCPAPI.IUUCPAPIServer”。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。”
Mine is windows application. I am using web service. When i add service reference to my application it is generated one app.config file.
<client>
<endpoint address="http://58.71.131.223/uucpapi/UUCPAPIServer.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IUUCPAPIServer"
contract="UUCPAPI.IUUCPAPIServer" name="WSHttpBinding_IUUCPAPIServer">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
and i am calling this API as
UUCPAPI.UUCPAPIServerClient uucp = new UUCPAPI.UUCPAPIServerClient();
here it is throwing exception as
Could not find default endpoint element that references contract
'UUCPAPI.IUUCPAPIServer' in theServiceModel
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."
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)