我已经成功创建了一个ASP.net网站来调用Soap Web服务。从类库中消费Web服务
现在我需要把它变成一个类库,我可以通过COM从经典ASP调用。
Consume web service in asp.net app from a class library上的这篇文章说,我需要添加Web服务作为使用“添加服务引用”而不是“添加Web引用”来添加对Web服务的引用。
当我尝试这样做,我得到一个错误:
Metadata contains a reference that cannot be resolved: ' http://theURL.com:8008/asmx/publicServiceAddress.asmx?wsdl '.
There was an error downloading ' http://theURL.com:8008/asmx/publicServiceAddress.asmx?wsdl '.
Unable to connect to the remote server A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 77.95.80.35:8008 Metadata contains a reference that cannot be resolved: ' http://theURL.com/asmx/publicServiceAddress.asmx '. Metadata contains a reference that cannot be resolved: ' http://theURL.com/asmx/publicServiceAddress.asmx '.
If the service is defined in the current solution, try building the solution and adding the service reference again.
...但是当我点击高级,然后添加然后在“添加Web引用”我可以添加它的罚款。
问题:
1)是否有必要使用“添加服务引用”,而不是“添加Web引用”?
2)为什么有什么区别?
3)什么是这个错误的潜在原因,我怎么可以算出来,比如我不知道为什么它会8080端口查找WSDL http://theURL.com:8008/asmx/reguspublic.asmx?wsdl时候就应该去http://theURL.com/asmx/reguspublic.asmx?wsdl
请参阅如何格式化消息。格式化指南位于编辑的右侧。例如,你需要在行尾加两个空格来换行。 – 2011-06-13 11:52:10