元数据包含无法解析的引用(Wrong wsdl url)

时间:2012-09-03 16:48:26

标签: c# asp.net web-services wsdl service-reference

添加Web引用或服务引用时,visual studio 2010会显示以下错误消息。实际wsdl网址为http://x.x.x.x:9999/PersonCRUD.asmx?wsdl。我不知道为什么visual studio会尝试从http://x.x.x.x/PersonCRUD.asmx?wsdl

下载
Metadata contains a reference that cannot be resolved: 'http://x.x.x.x/PersonCRUD.asmx?wsdl'.
There was an error downloading 'http://x.x.x.x/PersonCRUD.asmx?wsdl'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://x.x.x.x:9999/PersonCRUD.asmx'.
Metadata contains a reference that cannot be resolved: 'http://x.x.x.x:9999/PersonCRUD.asmx'.
If the service is defined in the current solution, try building the solution and adding the service reference again.

在wsdl的末尾有一个包含错误网址的部分。我想这是问题的根源。 (端口:9999缺失)

<wsdl:port name="PersonCRUDSoap" binding="tns:PersonCRUDSoap">
    <soap:address location="http://78.186.32.181/PersonCRUD.asmx"/>
</wsdl:port>
<wsdl:port name="PersonCRUDSoap12" binding="tns:PersonCRUDSoap12">
    <soap12:address location="http://78.186.32.181/PersonCRUD.asmx"/>
</wsdl:port>

BTW我在一个全新的网站项目中试过这个。

有没有人知道为什么会出现这种错误?

感谢。

0 个答案:

没有答案