Silverlight中的跨域安全错误

Silverlight中的跨域安全错误

本文介绍了Silverlight中的跨域安全错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将来自Yahoo Pipes的Feed读入Silverlight应用程序。我不断得到一个SecurityException,这听起来像一个跨域策略问题,但雅虎管道,如果你通过pipes.yahooapis域,有一个跨域策略,所以应该确定。我尝试完全相同的代码,但去Digg API,它工作正常(虽然这是休息,而不是一个RSS源)。

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));

我得到的异常是System.Security.SecurityException。

The exception I get is a System.Security.SecurityException.

我尝试的网址是这个网址。

The url I'm trying is this one

推荐答案

策略文件地方是:

<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <site-control permitted-cross-domain-policies="master-only" />
  <allow-access-from domain="*" />
</cross-domain-policy>

目前的问题是Silverlight不能使用整个Flash Cross Domain Policy文件格式。 。我希望网站控制元素打破它。

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.

这篇关于Silverlight中的跨域安全错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:59