添加WCF引用错误

问题描述:

当尝试一个WCF引用添加到.NET 2,我得到以下错误:添加WCF引用错误

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.

  • 的WCF是在远程服务器上托管的Web服务,我访问它使用互联网。这是我想添加作为参考:
    http://1.1.1.1/AccountService/MediatorAccounting.svc?wsdl
  • 当我尝试将此地址作为一个Web引用添加到.NET 4项目,我没有问题。离开.Net 4.0生成的配置文件,我看到绑定设置为使用wsHttpBinding。当试图从.Net 2客户端连接到服务时会导致问题吗?
    任何人都知道变通办法是什么?

UPDATE: 使用的地址,而不当这里的错误结果的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

这是确切的未完成错误的详细信息!

+0

WCF服务使用哪些绑定?为了对.NET 2.0可见,WCF必须使用basicHttpBinding。 – 2011-11-14 18:11:30

.Net 2.0上没有WCF。 WCF首先出现在.Net 3.0中。 .Net 2.0支持ASMX Web服务。如果您可以在服务器端将服务绑定更改为basicHttpBinding,则会使其与ASMX Web服务兼容。

它没有?wsdl后缀吗?也许它会尝试添加wsdl istelf,而不是它的服务。

+0

请参阅我的更新 – Kamyar 2011-03-12 06:09:23

尝试更改为配置中的服务器名称而不是“localhost”。