五月综合缴情婷婷六月,色94色欧美sute亚洲线路二,日韩制服国产精品一区,色噜噜一区二区三区,香港三级午夜理伦三级三

您現(xiàn)在的位置: 365建站網(wǎng) > 365文章 > Flex調(diào)用ASP.NET Web Service時的沙箱問題

Flex調(diào)用ASP.NET Web Service時的沙箱問題

文章來源:365jz.com     點擊數(shù):577    更新時間:2009-09-20 09:03   參與評論
  今天用Flex調(diào)用ASP.NET的Web Service時老是跳出了"Security error accessing url"的錯誤,查了資料,才知道這原來根Flash的沙箱有關(guān)。

  原理是,當SWF文件試圖訪問其它域上的數(shù)據(jù)時,F(xiàn)lash Player自動加載那個域上的policy文件,如果SWF文件所在的域被包含在這個policy文件中,數(shù)據(jù)就可以被訪問,否則就不行,以下是Adobe官方的原文:

When a SWF file attempts to access data from another domain, Flash Player automatically attempts to load a policy file from that domain. If the domain of the SWF file that is attempting to access the data is included in the policy file, the data is automatically accessible.

而我所碰到的問題,就是因為我的IIS上沒有這個policy file,那解決辦法自然就是加上這個policy file。

解決辦法

新建一個xml文件,命名為crossdomain.xml,如果不想麻煩的話,文件名就不要用其它的,就用這個。
把以下內(nèi)容復制到xml文件中:
<?xml version="1.0"?>
<cross-domain-policy>
  
<allow-access-from domain="*" />
</cross-domain-policy>
然后把它保存到wwwroot下面,我曾試著把它放到應用程序的根目錄,但不起作用,放到wwwroot下是可以的,上述的crossdomail.xml 允許所有的swf文件訪問本主機。

然后就OK了。如果想看更詳細的,就看:
http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=05B_Security_176_04.html
Tag標簽: flex,web service,asp.net

如對本文有疑問,請?zhí)峤坏浇涣髡搲?,廣大熱心網(wǎng)友會為你解答?。?點擊進入論壇

發(fā)表評論 (577人查看,0條評論)
請自覺遵守互聯(lián)網(wǎng)相關(guān)的政策法規(guī),嚴禁發(fā)布色情、暴力、反動的言論。
昵稱:
最新評論
------分隔線----------------------------

其它欄目

· 建站教程
· 365學習

業(yè)務咨詢

· 技術(shù)支持
· 服務時間:9:00-18:00
365建站網(wǎng)二維碼

Powered by 365建站網(wǎng) RSS地圖 HTML地圖

copyright © 2013-2024 版權(quán)所有 鄂ICP備17013400號