添加WCF引用错误
当尝试将 WCF 引用添加到 .NET 2 时,出现以下错误:
文档已被理解,但无法处理。
- WSDL 文档包含无法解析的链接。
- 此 XML 文档中禁止 DTD。
- WCF 是一个托管在远程服务器上的 Web 服务,我使用互联网访问它。这是我想添加作为参考的内容:
http://1.1.1.1/AccountService/MediatorAccounting.svc?wsdl - 当我尝试将此地址添加为 .NET 4 项目的 Web 引用,我没有问题。查看 .Net 4.0 生成的配置文件,我看到绑定设置为使用
wsHttpBinding
。尝试从 .Net 2 客户端连接到服务时,这会导致问题吗?
有人知道解决方法是什么吗?
更新: 这是使用不带 ?wsdl 的地址时的错误结果:
URL 处的文档 http://1.1.1.1/AccountService/MediatorAccounting.svc未被识别为已知文档类型。 每种已知类型的错误消息可能会帮助您解决问题: - 来自“http://1.1.1.1/AccountService/MediatorAccounting.svc”的报告是“文档
”
这是确切的未完成错误详细信息!”
When trying to add a WCF reference to .NET 2, I get the following error:
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- DTD is prohibited in this XML document.
- The WCF is a web service which is hosted on a remote server and I access it using internet. This is what I would like to add as a reference:
http://1.1.1.1/AccountService/MediatorAccounting.svc?wsdl - When I try to add this address as a web reference to a .NET 4 project, I have no problem. ion the .Net 4.0 generated config file, I see the bindings are set to use
wsHttpBinding
. Is this going to cause a problem when trying to connect from a .Net 2 client to the service?
Anyone knows what the workarounds are?
UPDATE:
here's the error result when using the address without ?wsdl:
The document at the url http://1.1.1.1/AccountService/MediatorAccounting.svc was not recognized as a known document type.
The error message from each known type may help you fix the problem:
- Report from 'http://1.1.1.1/AccountService/MediatorAccounting.svc' is 'The documen
this is the exact unfinished error details!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.Net 2.0 上没有 WCF。 WCF 最早出现在.Net 3.0 中。 .Net 2.0 支持 ASMX Web 服务。如果您可以在服务器端将服务绑定更改为 basicHttpBinding,这将使其与 ASMX Web 服务兼容。
There is no WCF on .Net 2.0. WCF first appeared first in .Net 3.0. .Net 2.0 supports ASMX web services. If you can change the service binding to basicHttpBinding on server side, that will make it compatible to ASMX web services.
没有 ?wsdl 后缀它可以工作吗?也许它尝试添加 wsdl istelf,而不是它的服务。
Does it work without ?wsdl suffix? Maybe it tries to add wsdl istelf, not the service of it.
尝试更改配置中的服务器名称而不是“localhost”。
Try changing to the server name in config instead of "localhost".