【发布时间】:2011-10-24 06:48:59
【问题描述】:
我们有一个带有
的 WCF RIA 域服务[EnableClientAccess(RequiresSecureEndpoint = true)]
我们将网站设置为使用 http 和 https。我们在网站的根目录中有一个客户端访问策略文件,如下所示:
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="http://*"/>
<domain uri="https://*"/>
</allow-from>
<grant-to>
<resource include-subpaths="true" path="/"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
当我们通过 https 访问 Silverlight 应用程序时,一切都很好。当我们通过 http 访问它时,会出现以下错误:
调用操作“工作”失败。尝试向 URI“https://localhost/ClientBin/SilverlightApplication3-Web-DomainService1.svc/binary/Working”发出请求时出错。这可能是由于在没有适当的跨域策略或不适合 SOAP 服务的策略的情况下尝试以跨域方式访问服务。您可能需要联系服务的所有者以发布跨域策略文件并确保它允许发送与 SOAP 相关的 HTTP 标头。此错误也可能是由于在 Web 服务代理中使用内部类型而不使用 InternalsVisibleToAttribute 属性造成的。有关详细信息,请参阅内部异常。
这意味着我们的政策文件不正确,但看不到什么。有什么想法吗?
【问题讨论】:
标签: silverlight wcf-ria-services