Tuesday, September 4, 2012

javascript calls silverilght with xap loaded from remote server

javascript calls silverilght with xap loaded from remote server

I have a web app which loads a silverlight XAP from a remote server (S3). Javascript needs to call a Silverlight function from the XAP loaded from the remote server.

It works fine if both the xap and javascript are on the same server, but does not work if the xap is on a remote server. The silverlight loads fine, but the javascript gets a null value when accessing the silverlight control.Content.

I imagine the error is in a cross domain policy or client access policy. The app already uses a clientaccesspolicy successfully in other situations, but perhaps I need to add something to it. Here is my clientaccesspolicy

   <?xml version="1.0" encoding="utf-8"?> <access-policy>   <cross-domain-access>     <policy>       <allow-from http-request-headers="*">         <domain uri="*"/>       </allow-from>       <grant-to>         <resource path="/" include-subpaths="true"/>       </grant-to>     </policy>   </cross-domain-access> </access-policy> 

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog