crossdomain.xml和clientaccesspolicy.xml有什么区别?
[已解决] crossdomain.xml和clientaccesspolicy.xml有什么区别?
当前页面:http://www.senparc.com/SZD-177
{ 收藏当前页面 }
最佳答案
SilverLight要实现跨域访问,必须在服务端被访问域的直接域名下,配置 clientaccesspolicy.xml( 或 crossdomain.xml)文件,即可以访问 http://{domainName}/clientaccesspolicy.xml。
具体来说,如果后台服务部署在IIS中,默认是放在“inetpub/wwwroot”目录下;如果后台服务是部署在Tomcat中,默认是放在“tomcat\webapps\ROOT”目录下。
Flash 和 Silverlight 的 crossdomain.xml 是通用的,Flash 的跨域请求应该也是一样的原理
这两个文件并不都需要放在域根下,但我更喜欢用clientaccesspolicy,因为他可以用来设置Socket.
它们的区别说明在B2的文档中
Silverlight supports two types of security policy files:
•Flash policy file - the existing crossdomain.xml policy file used by Adobe Flash. This policy file can only be used by the WebClient and HTTP classes in the System.Net namespace. A Flash policy file must allow access to all domains to be used by the Silverlight 2 runtime.
•Silverlight policy file - the Silverlight policy file that can be used by the WebClient and HTTP classes in the System.Net namespace and also by the sockets classes in the System.Net.Sockets namespace. This policy file has a different format than the Flash policy file.
All in all, Silverlight policy can be used by all kinds of Connection between Client and Server.
Refer to your question, if you only put one of them onto the root, cross-domain-access is also allowed, but for crossdomain.xml CrossDomain for Sockets doesn't allow.
具体来说,如果后台服务部署在IIS中,默认是放在“inetpub/wwwroot”目录下;如果后台服务是部署在Tomcat中,默认是放在“tomcat\webapps\ROOT”目录下。
Flash 和 Silverlight 的 crossdomain.xml 是通用的,Flash 的跨域请求应该也是一样的原理
这两个文件并不都需要放在域根下,但我更喜欢用clientaccesspolicy,因为他可以用来设置Socket.
它们的区别说明在B2的文档中
Silverlight supports two types of security policy files:
•Flash policy file - the existing crossdomain.xml policy file used by Adobe Flash. This policy file can only be used by the WebClient and HTTP classes in the System.Net namespace. A Flash policy file must allow access to all domains to be used by the Silverlight 2 runtime.
•Silverlight policy file - the Silverlight policy file that can be used by the WebClient and HTTP classes in the System.Net namespace and also by the sockets classes in the System.Net.Sockets namespace. This policy file has a different format than the Flash policy file.
All in all, Silverlight policy can be used by all kinds of Connection between Client and Server.
Refer to your question, if you only put one of them onto the root, cross-domain-access is also allowed, but for crossdomain.xml CrossDomain for Sockets doesn't allow.
回答时间:2010/8/8 14:52:30
| 回答者:56max
其他参考答案(0)
提交失败!请检查错误!错误信息:
以下信息或许对您有用:
- [已解决] 20 Silverlight的InitParams参数如何使用?能否输入多个参数?如何... 2010/10/27 18:28:51
- [已解决] 5 Silverlight 2.0支持把网页上的Silverlight程序安装到桌面... 2010/9/10 11:55:09
- [已解决] 5 Silverlight 3.0是单线程还是多线程?是否可以创建多个线程同步执行? 2010/9/9 22:54:10
- [已解决] 10 Silverlight如何关闭整个浏览器窗口? 2010/8/26 11:13:11
- [已解决] 10 silverlight 在网页中背景透明,如何做到? 2010/8/19 18:05:44