【发布时间】:2009-06-12 16:39:46
【问题描述】:
我有一个部署在我的测试服务器上的 WCF 服务。尝试在我的测试项目中使用它,我添加了一个参考,我得到了这个错误
The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://localhost:8731/somewhere.nowhere.com/service1/?xsd=xsd2'.
- Unable to connect to remote server
- No connection could be made because the target machine actively refused it
Metadata contains a reference that cannot be resolved: 'http://192.1.1.1/TestService/somewhere.nowhere.com.svc?wsdl'.
Content Type application/soap+xml; charset=utf-8 was not supported by service . The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'..
If the service is defined in the current solution, try building the solution and adding the service reference again.
在我将 wsdlextras 添加到我的服务项目以包含 wsdl 文档之前,我的测试应用程序正在运行。
这是来自我的 wsdl 的架构:
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:8731/somewhere.nowhere.com/?xsd=xsd2" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://localhost:8731/somewhere.nowhere.com/?xsd=xsd1" namespace="http://schemas.datacontract.org/2004/07/TestService"/>
<xsd:import schemaLocation="http://localhost:8731/somewhere.nowhere.com/?xsd=xsd0" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://localhost:8731/somewhere.nowhere.com/?xsd=xsd3" namespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
</xsd:schema>
</wsdl:types>
尝试修复 1: 我改变了我的
<host>
<baseAddresses>
<add baseAddress />
</baseAddresses>
</host>
所以我的架构中的地址都匹配了。我可以在我的测试项目中更新我的服务引用,但是我无法查看我的 wcf 服务公开的任何方法。
我的服务部署在 Windows 2003 上,我的测试应用也在 XP 上
【问题讨论】:
-
尝试 ping 192.1.1.1,如果你得到结果试试 telnet 192.1.1.1 8731 命令来检查你是否有与服务器的连接,可能是防火墙阻止了连接,你是在 vista 上部署服务器吗?
标签: wcf