0

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>`  
BenMorel
  • 34,448
  • 50
  • 182
  • 322
Tucker
  • 7,017
  • 9
  • 37
  • 55
  • When you say it fails; how does it fail? Do you get a runtime error? If so, what is the error? Please include the full stack trace. If it fails in some other manner, please provide more as many details as possible on what the failure is. – JeffryHouser May 21 '12 at 18:07
  • Thanks for your answer, I figured it out. I had the remoting service call https://www.domain01.com and i added the following code to my flex app 'Security.allowDomain( "www.domain02.com" ); Security.loadPolicyFile( "https://www.domain02.com/crossdomain.xml" ); var request:URLRequest = new URLRequest( "https://www.domain02.com/crossdomain.xml" ); var loader:URLLoader = new URLLoader(); loader.load( request ); ' – Tucker May 21 '12 at 19:10

1 Answers1

0

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 );
JeffryHouser
  • 39,401
  • 4
  • 38
  • 59
Tucker
  • 7,017
  • 9
  • 37
  • 55