无法在Visual Studio 2010 IDE中将启用HTTPS的WCF服务添加为服务引用 [英] Not able to add HTTPS enabled WCF Service as Service reference in Visual Studio 2010 IDE

查看:283
本文介绍了无法在Visual Studio 2010 IDE中将启用HTTPS的WCF服务添加为服务引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通过Visual Studio 2010 IDE添加启用HTTPS的WCF服务作为服务引用时,发生了以下异常

While adding a HTTPS enabled WCF Service as Service reference through Visual Studio 2010 IDE, the following exception occured

下载"https://abc.cloudapp.net/DataService.svc"时出错.
请求失败,HTTP状态为403:禁止.
元数据包含无法解析的引用:"https://abc.cloudapp.net/DataService.svc".
禁止使用客户端身份验证方案匿名"的HTTP请求.
远程服务器返回错误:(403)禁止.
如果服务是在当前解决方案中定义的,请尝试构建解决方案并再次添加服务引用.

There was an error downloading 'https://abc.cloudapp.net/DataService.svc'.
The request failed with HTTP status 403: Forbidden.
Metadata contains a reference that cannot be resolved: 'https://abc.cloudapp.net/DataService.svc'.
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.

请让我知道解决此问题的解决方法.

Please let me know the workaround to resolve this issue.

推荐答案

您可以在IE上访问基于https的URL并获得WSDL吗?如果您可以在IE中毫无问题地获得WSDL,则说明您的计算机中确实安装了证书,而VS却以某种方式无法使用客户端证书并返回此错误.如果你不能得到 WSDL在您的计算机中,然后您需要先在计算机中安装客户端证书,然后重试.

Can you access https based URL on IE and get WSDL? If you can get WSDL in IE without any problem then you do have certificate installed in your machine and VS somehow not able to use the client certificate and return this error.  IF you can not get WSDL in your machine, then you need to install client certificate in your machine first and try again.

如果要解决Visual Studio的此问题,则可以使用IE获取HTTPs WCF服务元数据wsdl页面,并将WSDL保存在本地计算机上.在打开VS2010之后,当您选择添加ServiceReference"时,路由到已保存的WSDL元数据 文件,这样您的Secure WCF服务的代理类将被生成,您仍然可以使用它.

IF you want to workaround this issue with Visual Studio, you can use your IE to get the HTTPs WCF service metadata wsdl page and save WSDL on your local machine. After that open VS2010 and when you select "Add ServiceReference", route to saved WSDL metadata file on your machine, this way a Proxy Class for your Secure WCF service will be generated and you can still use it.


这篇关于无法在Visual Studio 2010 IDE中将启用HTTPS的WCF服务添加为服务引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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