无法访问 silverlight web 服务
我有一个允许一切的clientaccesspolicy.xml
。
我使用 javascript 从同一服务器的 aspx 弹出一个窗口。
aspx 调用 Web 服务但失败。
silverlight System.Security.SecurityException:安全错误。这 可能是由于尝试以跨域方式访问服务 没有适当的跨域策略,或者策略 不适合 SOAP 服务。
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
有什么想法吗?
I have a clientaccesspolicy.xml
that allows everything.
I use javascript to pop up a window from an aspx from the same server.
The aspx calls the web service but fails.
silverlight System.Security.SecurityException: Security error. This
could be due to attempting to access a service in a cross-domain way
without a proper cross-domain policy in place, or a policy that is
unsuitable for SOAP services.
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为问题在于您配置的“ClientConfig.xml”文件应该称为“clientaccesspolicy.xml”并且位于网站的根目录中。
此处 是 Tim Heuer 撰写的一篇关于使用 clientaccesspolicy 文件的精彩文章。
I think the problem is that the file you have configured "ClientConfig.xml" should be called "clientaccesspolicy.xml" and be in the root of the website.
Here is a great post by tim heuer on using the clientaccesspolicy file.
我的 servicereference.clientconfig 指向 localhost 而不是部署服务器:-(
My servicereference.clientconfig was pointing to localhost instead of the deploy server :-(