在Silverlight中实现跨域访问

目前有以下几种方法:

  1. Call, write, and ask the company/person to list your domain (i.e., the domain from which your Silverlight application is downloaded) as an allowed domain in the client policy file (clientaccesspolicy.xml or crossdomain.xml) – may not be very reasonable.
  2. Create your own proxy – the proxy will sit on your domain, and will make calls to the external domain. Hence, your Silverlight app will call the proxy on the same domain, so the Silverlight runtime will avoid asking for the cross domain policy file. Your proxy will simply call the external service and pass the response back to the Silverlight application.
  3. Use a third party proxy service instead of rolling your own – such as Yahoo Pipes @ http://pipes.yahoo.com/pipes or the Google AJAX Feed API @ http://code.google.com/apis/ajaxfeeds.
  4. Trick the browser and avoid using any proxy whatsoever. This only works if the Silverlight application can access the HTML Bridge and inject a JavaScript element into the head tag of the page. Also, you need to understand how to pass the response into a Silverlight control. If you don’t know how this can be accomplished, then this approach will not work for you. This is the option I will discuss further, since the other ones are self explanatory.
原文地址:https://www.cnblogs.com/xixifusigao/p/1643910.html