无法从特定计算机添加对SSL WCF服务的引用。 [英] Cannot add reference to SSL WCF service from specific machine.

查看:63
本文介绍了无法从特定计算机添加对SSL WCF服务的引用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法添加对需要客户端证书的WCF服务的引用。 我收到以下错误:

I cannot add a reference to a WCF service that requires a client certificate.  I get the following error:

下载'https://xxx.xxx.com'时出错。

请求失败,HTTP状态为403:禁止。

元数据包含无法解析的引用:'https://xxx.xxx.com/'。

HTTP请求被禁止使用客户端身份验证方案' Anonymous'。

远程服务器返回错误:(403)Forbidden。

如果在当前解决方案中定义了服务,请尝试构建解决方案并添加服务引用再次。

There was an error downloading 'https://xxx.xxx.com'.
The request failed with HTTP status 403: Forbidden.
Metadata contains a reference that cannot be resolved: 'https://xxx.xxx.com/'.
The HTTP request was forbidden with client authentication scheme 'Anonymous'.
The remote server returned an error: (403) Forbidden.
If the service is defined in the current solution, try building the solution and adding the service reference again.

更多信息:

- 在任何其他机器上添加引用都没有问题。 只有我正在使用的那些。 所有其他机器都可以在任何IDE中添加引用而不会出现问题。

-There have been no problems adding the reference on ANY of our other machines.  Only the ones that I am using.  All other machines can add the reference in any IDE without problems.

- 我在VS2010和VS2008中得到相同的错误

-I get the same error in VS2010 and VS2008

- 我尝试过重置我的VS设置并重新安装我的所有IDE

-I have tried resetting my VS settings and reinstalling all of my IDEs

- 在其他计算机上添加引用时,IDE会在添加引用时提示输入客户端证书。 我的IDE没有提示,虽然我安装了证书。

-When adding the reference on other machines, the IDE will prompt for a client cert when adding the reference.  My IDEs do not prompt, though I have the cert installed.

- 我可以浏览(通过Internet Explorer)到服务URL并使用正确的证书查看网页和wsdl。

-I can browse (via Internet Explorer) to the service url and view the web page and the wsdl using the correct certificate.

- 当我尝试将该服务添加为Web引用时,我收到同样的错误。 我也可以尝试使用相同的错误直接向wsdl添加引用,尽管我实际上可以从Web服务预览窗口查看服务网页和wsdl。 
"添加参考"按钮在此时显示为灰色。

-When I try to add the service as a web reference, I get the same error.  I can also try to add a reference directly to the wsdl with the same errors, although I can actually view the service web page AND the wsdl from the web service preview window.  The "Add Reference" button is greyed out at this time.

- 我可以在另一台机器上成功添加引用,将解决方案检查到源代码管理中,然后将代码拉到"已损坏"状态。机器和代码将构建并实际成功运行,即参考在损坏的机器上工作,因为它是由另一台机器添加的

-I can add the reference successfully on another machine, check the solution into source control, and then pull the code onto the "broken" machine and the code will build and actually runs successfully, i.e. the reference works on the broken machine as long as it was added by a different machine.

任何想法?

推荐答案

你好screamatamonkey,



根据你的描述,问题是针对一台机器的当您尝试针对https / ssl安全WCF服务添加serviceREference时。此外,您提到您可以在通过webbrowser直接访问元数据页面时正确访问该元数据页面。
然后,当您使用webbrowser(IE)访问服务页面(或wsdl元数据页面)时是否有任何警告?如果有警告,则可能表示客户端计算机上不信任SSL服务证书(或者服务器名称与
证书的主题名称不匹配)。 webbrowser可以容忍这样的警告,但是当您使用工具以编程方式访问https端点时可能会导致错误。如果是这种情况,请尝试验证服务ssl证书是否已安装在客户端计算机上的受信任
商店中。



此外,可能的解决方法是您可以先使用webbrowser访问元数据wsdl页面并将wsdl文档保存到本地磁盘。然后,在Visual Studio"Add ServiceReference"中向导,使用本地磁盘上的wsdl元数据文档生成
代理类。
Hi screamatamonkey,

Based on your description, the problem is specific to one machine when you try adding serviceREference against a https/ssl secured WCF service. Also, you mentioned that you can correctly visit the metadata page when you directly access it through webbrowser. Then, is there any warning when you use webbrowser(IE) to visit the service page(or wsdl metadata page)? If there is warning, it probably indicate that the SSL service certificate is not trusted at your client machine(or the servername doesn't match the certificate's subjectname). And such warning can be toleranted by webbrowser, but might cause error when you use tools to programmtically access the https endpoint. If this is the case, try verifying that the service ssl certificate has been installed in trusted store on your client machine.

Also, a possible workaround is that you can first use webbrowser to visit the metadata wsdl page and save the wsdl document to local disk. Then, in the Visual Studio "Add ServiceReference" wizard, use the wsdl metadata document on local disk to generate the proxy class.


这篇关于无法从特定计算机添加对SSL WCF服务的引用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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