我在我的测试服务器上部署了一个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服务公开的任何方法。
我的服务部署在windows2003上,我的测试应用程序也部署在XP上。
发布于 2012-06-28 15:02:37
答案在这里:WCF IIS server configuration
简而言之。问题出在WCF标识权限上。用于承载WCF服务的应用程序池的标识必须对%WINDIR%\temp文件夹具有完全NTFS权限。在C:\Windows\Temp上将权限更改为我的身份(本地服务)后,我可以向WCF服务添加服务引用。
发布于 2009-06-22 03:41:55
从错误消息看,它似乎找不到导入的xsd文件xsd2。
对服务的调用看起来像是在端口80上,但包含文件是从点8731引用的。
https://stackoverflow.com/questions/987710
复制相似问题