当前位置: 动力学知识库 > 问答 > 编程问答 >

unable to use WCF service in c# project - MetaData Error

问题描述:

Service Location:

http://1.1.1.1:5670/Test_Service/Service.SearchService.svc

Error:

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.

This only happens when i am not on the VPN. If i am on the VPN things work well. Also mycompany.com is only availalbe internally.

I can view the WSDL when not connected to the VPN

网友答案:

Your VPN probably gives you an ip address in the 1.1.1.* subnet (internal to your company's network). So, when you are connected to VPN, you can reach the server and when you are not connected, you cannot (because you are outside the company's network without VPN).

There is likely no resolution to this issue unless your company is willing to expose that server externally. Just use your VPN.

Per comment: Yes and you can see the WSDL like this http://1.1.1.1:5670/Test_Service/Service.SearchService.svc?wsdl but you will need to be VPN'd in. :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: