添加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我在一个全新的网站项目中试过这个。
有没有人知道为什么会出现这种错误?
感谢。