【发布时间】:2012-07-13 13:51:33
【问题描述】:
我在 vs2010 中有一个包含一些项目的解决方案:
一个 wcf 项目 一个赢的形式项目 一个类库我的类库有 wcf 服务的引用。当我尝试在 winform 应用程序中使用此引用从 wcf 检索数据时,出现此错误:
Could not find default endpoint element that references contract 'MikServiceShopInfo.IshopsService' 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.
我把类库的 app.config 改成这样:
<endpoint address="http://localhost:8855/LaptopsInfoService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_ILaptopsInfoService"
contract="ILaptopsInfoService"
name="BasicHttpBinding_ILaptopsInfoService" />
<endpoint address="http://localhost:8855/shopsService.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IshopsService"
contract="IshopsService"
name="BasicHttpBinding_IshopsService" />
【问题讨论】:
标签: wcf .net-4.0 wcf-binding