Unable to add a secure web reference in VS.Net 2010

老子叫甜甜 提交于 2019-12-11 06:43:22

问题


Background: I've been tasked with creating a single sign on solution which will redirect our internal users to a vendor's web application. I've set it up as an ASP.Net project which will call a web service provided by the vendor. This service will return a URL and a token to be used to sign in to the vendor's site. All this is to be done securely.

Problem: When using Visual Studio's Add Web Reference dialog to download the WSDL and generate the required proxy class, I get the following error:

There was an error downloading 'https://server:port/folder/Service?wsdl'. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. Metadata contains a reference that cannot be resolved: 'https://server:port/folder/Service?wsdl'. An error occurred while making the HTTP request to https://server:port/folder/Service?wsdl. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server. The underlying connection was closed: An unexpected error occurred on a send. Authentication failed because the remote party has closed the transport stream. If the service is defined in the current solution, try building the solution and adding the service reference again.

In addition to this error, the Add Reference button is grayed out, preventing me from adding the reference and generating the proxy class.

The project is running under .Net Framework 4.0. I've downloaded and installed the necessary client keys/certificates correctly. I've added the IP address and server name to the hosts file and added both to the proxy bypass list. I can browse to the endpoint and view the WSDL in IE and VS's web browser. I can even view the WSDL in the Add Web Reference dialog box in VS. In each case, I'm prompted to select which certificate to use, which I do.

I do not have access to the web service itself or the server it is located on.

I've spent many hours on Google, but have not been able to find a resolution. Any ideas?


回答1:


Worked around the issue by downloading the WSDL and pulling it into VS through the Add Web Reference dialog by referencing the URL file:\\\drive:\pathname\filename.wsdl.



来源:https://stackoverflow.com/questions/10001330/unable-to-add-a-secure-web-reference-in-vs-net-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!