找不到默认端点元素 [英] Could not find default endpoint element

查看:31
本文介绍了找不到默认端点元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经向 VS2008/.NET 3.5 解决方案中的网络服务添加了代理.构建客户端 .NET 时抛出此错误:

I've added a proxy to a webservice to a VS2008/.NET 3.5 solution. When constructing the client .NET throws this error:

在 ServiceModel 客户端配置部分中找不到引用合同IMySOAPWebService"的默认端点元素.这可能是因为找不到您的应用程序的配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素.

Could not find default endpoint element that references contract 'IMySOAPWebService' in the ServiceModel client configuration section. This might be because no configuaration file was found for your application or because no endpoint element matching this contract could be found in the client element.

搜索这个错误告诉我在合约中使用完整的命名空间.这是我的具有完整命名空间的 app.config:

Searching for this error tells me to use the full namespace in the contract. Here's my app.config with full namespace:

<client>
  <endpoint address="http://192.168.100.87:7001/soap/IMySOAPWebService"
            binding="basicHttpBinding" bindingConfiguration="IMySOAPWebServicebinding"
            contract="Fusion.DataExchange.Workflows.IMySOAPWebService" name="IMySOAPWebServicePort" />
</client>

我在本地运行 XP(我提到这一点是因为许多 Google 搜索都提到了 win2k3)app.config 被复制到 app.exe.config,所以这也不是问题.

I'm running XP local (I mention this because a number of Google hits mention win2k3) The app.config is copied to app.exe.config, so that is also not the problem.

有什么线索吗?

推荐答案

测试了几个选项,我终于用

Having tested several options, I finally solved this by using

contract="IMySOAPWebService"

contract="IMySOAPWebService"

即在配置中没有完整的命名空间.由于某种原因,全名没有正确解析

i.e. without the full namespace in the config. For some reason the full name didn't resolve properly

这篇关于找不到默认端点元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆