Silverlight 中的跨域安全错误?
我正在尝试将 Yahoo Pipes 的提要读入 Silverlight 应用程序。 我不断收到 SecurityException,这听起来像是跨域策略问题,但是雅虎管道,如果您通过 Pipes.yahooapis 域,则具有跨域策略,所以应该没问题。 我尝试了完全相同的代码,但是转到 Digg API,它工作正常(尽管这是休息而不是 rss feed)。 我的错误可能与跨域策略无关吗?
我对 Web 请求使用以下代码:
WebClient wc = new WebClient();
wc.DownloadStringAsyncCompleted += new DownloadStringCompletedEventHandler(wc_DlStrCompleted);
wc.DownloadStringAsync(new Uri(yahooPipesUrl));
我得到的异常是 System.Security.SecurityException。
我正在尝试的网址是这个
I'm trying to read a feed from Yahoo Pipes into a Silverlight Application. I keep getting a SecurityException, which sounds like a cross domain policy problem, but Yahoo pipes, if you go through the pipes.yahooapis domain, has a cross domain policy, so should be ok. I tried the exact same code, but going to the Digg API, and it works fine (although this is rest rather than an rss feed). Could my error have nothing to do with Cross Domain policies?
I use the following code for the web request :
WebClient wc = new WebClient();
wc.DownloadStringAsyncCompleted += new DownloadStringCompletedEventHandler(wc_DlStrCompleted);
wc.DownloadStringAsync(new Uri(yahooPipesUrl));
The exception I get is a System.Security.SecurityException.
The url I'm trying is this one
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
现有的策略文件是:
当前存在一个问题,即 Silverlight 无法与整个 Flash 跨域策略文件格式一起工作...我预计站点控制元素会破坏它。
The policy file in place is:
There is a current problem that Silverlight does not work with the entire Flash Cross Domain Policy file format...I would expect that the site-control element is breaking it.
crossdomain.xml 策略文件位于 http://pipes.yahooapis.com/crossdomain.xml在allow-access-from 元素中仅指定安全(https:) 请求。 请参阅此处:
The crossdomain.xml policy file at http://pipes.yahooapis.com/crossdomain.xml specifies only secure (https:) requests in the allow-access-from element. See the documentation about the format here:
http://pipes.yahoo.com/crossdomain.xml
或 http://pipes.yahoo.com/clientaccesspolicy.xml
因此 SecurityException 是正确的行为。
您尝试访问的确切 URL 是什么?
There is no Client Access policy file at http://pipes.yahoo.com/crossdomain.xml
or http://pipes.yahoo.com/clientaccesspolicy.xml
Therefore the SecurityException is correct behavior.
What is the exact URL that you are trying to access?