我在 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" />