通过https调用WCF服务
我最近在 WCF 服务上实现了 SSL。 我将它部署在IIS服务器上,该服务器位于网络的另一台机器上(我的开发机器没有IIS,所以我无法在本地测试)。 每当我尝试调用 WCF 服务时,都会遇到错误:
“CommunicationException...失败...请求跨域策略...接受 SOAP http 标头...”当然,您知道我是什么我正在谈论。
我浏览了所有论坛,但没有得到答案。 SSL 证书是一种自签名证书。 我可以查看已部署服务的 wsdl,因此我认为证书配置没问题。
我的跨域文件(其内容与我的clientaccesspolicy文件完全相同): (在论坛中显示我的文件时出现问题)
--?xml version="1.0" encoding="utf-8"?>
->access-policy>
->cross-domain-access>
->policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="https://*"/>
<domain uri="http://*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
/access-policy>
I have recently implemented SSL on a WCF service. I deployed it on a IIS server, which is on another machine of the network (my developer machine doesn't have IIS, so i can't test locally). Whenever i try to call the WCF service, i'm having the error:
"CommunicationException... failed... ask for cross-domain policy... which accept SOAP http header..." sure, you know what i'm talking about.
I skimmed through all forums, but i got no answer. The SSL certificate is a self-signed one. I'm able to view the wsdl of my deployed service, so i think the certificate config is ok.
My cross-domain file (which has exactly the same content than my clientaccesspolicy file):
(Problem with displaying my file in the forum)
--?xml version="1.0" encoding="utf-8"?>
->access-policy>
->cross-domain-access>
->policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="https://*"/>
<domain uri="http://*" />
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
/access-policy>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的网站和 Web 服务都启用了 SSL,它们部署在不同的端口上。 我已经使用“http://localhost:port/TestPage.aspx< 在本地计算机上测试了 Web 服务调用/a>”和“https://IISserverName:port/TestPage.aspx”,但没有一个是在职的。
SSL is enabled for both my web site and my web service, which are deployed on separate ports. I have tested the web service call on my local machine, using "http://localhost:port/TestPage.aspx" and "https://IISserverName:port/TestPage.aspx", but none is working.