我在这个网站上有一个wcf服务http://wswob.somee.com/wobservice.svc
我尝试使用我的winform应用程序来使用该服务.这是我创建服务即时时收到的错误
com.somee.wobservice.IwobserviceClient myservice = new com.somee.wobservice.IwobserviceClient();
错误:
Could not find default endpoint element that references contract 'com.somee.wobservice.Iwobservice' 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文件:
和我在wcf文件夹中的web.config:
我不确定哪个部分出错了.我对wcf的体验只有一周......
从库项目中的app.config复制system.serviceModel部分,并将其放在web.config和刷新服务引用中.另见这个答案.找不到默认端点元素