无法在VS.Net 2010中添加安全的Web参考 [英] Unable to add a secure web reference in VS.Net 2010

查看:131
本文介绍了无法在VS.Net 2010中添加安全的Web参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景:我的任务是创建一个单点登录解决方案,该解决方案会将我们的内部用户重定向到供应商的Web应用程序.我将其设置为ASP.Net项目,该项目将调用供应商提供的Web服务.该服务将返回一个URL和一个令牌,用于登录供应商的站点.所有这一切都必须安全完成.

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.

问题:使用Visual Studio的 添加Web引用 对话框下载WSDL并生成所需的代理类时,出现以下错误:

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:

下载时出错 "https://server:port/folder/Service?wsdl".这 基础连接已关闭: 发送.验证失败,因为远程方已关闭 运输流.元数据包含的引用不能 解决: "https://server:port/folder/Service?wsdl".一个 发出HTTP请求时发生错误 https://server:port/folder/Service?wsdl .这 可能是由于未配置服务器证书 在HTTPS情况下正确使用HTTP.SYS.这也可能是由于 客户端和服务器之间的安全绑定不匹配. 基础连接已关闭:发生意外错误 发送.验证失败,因为远程方已关闭 运输流.如果服务是在当前解决方案中定义的, 尝试构建解决方案并再次添加服务引用.

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.

该项目在.Net Framework 4.0下运行.我已经正确下载并安装了必要的客户端密钥/证书.我已将IP地址和服务器名称添加到hosts文件,并将两者都添加到代理绕过列表.我可以浏览到端点并在IE和VS的Web浏览器中查看WSDL.我什至可以在VS的 添加Web参考 对话框中查看WSDL.在每种情况下,系统都会提示我选择要使用的证书.

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.

我无权访问Web服务本身或Web服务所在的服务器.

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

我已经在Google上花费了很多时间,但是找不到解决方法.有什么想法吗?

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

推荐答案

通过下载WSDL并通过 添加Web参考 对话框将其拉入VS来解决此问题.通过引用URL file:\\\drive:\pathname\filename.wsdl.

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.

这篇关于无法在VS.Net 2010中添加安全的Web参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆