无法在c#项目中使用WCF服务 - 元数据错误

时间:2009-07-23 18:28:20

标签: wcf

服务地点: http://1.1.1.1:5670/Test_Service/Service.SearchService.svc

错误:

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://mycompany.com/Test_Service/Service.SearchService.svc?xsd=xsd2'.
  - The remote name could not be resolved: 'mycompany.com'
Metadata contains a reference that cannot be resolved: 'http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl'.
There was no endpoint listening at http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl that could accept the message. 
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.

这只发生在我不在VPN上时。如果我在VPN上工作得很好。此外,mycompany.com仅在内部可用。

我可以在未连接到VPN时查看WSDL

1 个答案:

答案 0 :(得分:0)

您的VPN可能会在1.1.1。*子网(公司网络内部)中为您提供IP地址。因此,当您连接到VPN时,您可以访问服务器,当您没有连接时,您不能(因为您在没有VPN的公司网络之外)。

除非您的公司愿意在外部公开该服务器,否则可能无法解决此问题。只需使用您的VPN。

每条评论:是的,你可以看到像这样的http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl的WSDL,但是你需要在VPN中进行。:)