Question

I have an Apache server that serves two virtual hosts https://www.domain01.com and https://www.domain02.com. Apache is configured so that the 'Document Root' for both domain01 and domain02 are the same directory on the server. So in this configuration, both of these domains serve up the same website and the SAME flex app .swf file.

This flex app preforms https remoting to access data from https://www.domain01.com.

When the app is loaded from https://www.domain01.com, the app's remoting functionality works well. However, when the app is loaded from https://www.domain02.com, the app's remoting functionality fails.

I have a cross domain file and it is shown at the end of this post.

How can I get remoting to always work when the app is loaded from domain01 or domain02?

<?xml version="1.0"?>`  
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">`  
<cross-domain-policy>`  
<allow-access-from domain="*" secure="false"/>`  
<allow-http-request-headers-from domain="*" headers="*" secure="false" />`  
</cross-domain-policy>`  
Was it helpful?

Solution

I figured it out. I had the remoting service call domain01.com and i added the following code to my flex app

Security.allowDomain( "www.domain02.com" );  
Security.loadPolicyFile( "domain02.com/crossdomain.xml" );    
var request:URLRequest = new URLRequest( "domain02.com/crossdomain.xml" );  
var loader:URLLoader = new URLLoader(); 
loader.load( request );
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top