2

添加 Web 引用或服务引用时,Visual Studio 2010 显示以下错误消息。实际的 wsdl 网址是http://x.x.x.x:9999/PersonCRUD.asmx?wsdl. 我不知道为什么视觉工作室试图从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 的末尾有包含错误 url 的部分。我想这是问题的根源。(缺少端口: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>

顺便说一句,我在一个全新的网站项目中尝试了这个。

有没有人知道为什么会发生这个错误?

谢谢。

4

0 回答 0