Highlighted

invoke remoting endpoint crossdomain

_Joanna_Gao_

09-09-2008

I need to invoke work process through remoting endpoint in flex app from other domain.



my flex app is on : http://localsever.me.com:9001/test.swf



in this test.swf, I try to invoke a process that is throught remoting end point

http://remote.me.comremoting/remoting/messagebroker/amf



I got error message with "Security Sandbox Violation" error.



Has anybody done this before successfully?



Thanks,



Joanna Gao

Replies

Highlighted

Avatar

Guest

10-09-2008

You can initiate request only on the same domain by default. If your swf is loaded from http://localsever.me.com:9001/ it can do remote calls by default only to the same domain. Otherwise you need a file called crossdomain.xml located on the other domain which will grant permission to your swf.



Read http://labs.adobe.com/wiki/index.php/Flex:Accessing_Data#Using_crossdomain.xml_files for more information
Highlighted

_Joanna_Gao_

10-09-2008

Thanks for the reply.



I am calling a livecycle service remoting end point, which is generated automatically by LiveCycle for each process.



Do you know where the LiveCycle app root directoy is so I can place the crossdomain.xml file in?



Thanks,



Joanna
Highlighted

pguerett

10-09-2008

It would be in the app root of the application server that you are running ...not the LC application root.



Which app server are you using?
Highlighted

_Joanna_Gao_

10-09-2008

That is what I am trying to find out because there are 3 ear files deployed on the weblogic app server. but I am not sure where the port 8001 exactly points too.



Here is the folder structure under myApp server

Bea

-- user_projects

-- domain

-- LiveCycle

-- servers

--Admin

--MyApp

--Cache

--data

--logs

--security

--stage

--tmp



So which folder I should place crossdomain.xml file into? or I have to unzip the ear file to add it in?



Thanks,

Joanna
Highlighted

Avatar

Guest

11-09-2008

Should be in the ear file (on root). But you can place the file in other places if you want and use Security.loadPolicyFile method
Highlighted

_Joanna_Gao_

11-09-2008

thanks!<br />I added the crossdomain.xml file into the ear file.<br />and used Security.loadPolicyFile("http://myserver.com:8001/remoting/crossdomain.xml")<br /><br />but flex just ignored my policy file saying: <br /><br />Error: [strict] Ignoring policy file at<br />http://myserver:8001/remoting/crossdomain.xml due to missing Content-Type. See http://www.adobe.com/go/strict_policy_files to fix this problem.<br /><br />Here is my crossdomain.xml. How should I add the content type? Can you provide me example? I am using Flash player 9<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><!DOCTYPE cross-domain-policy SYSTEM<br />"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"><br /><br /><cross-domain-policy><br /> <site-control permitted-cross-domain-policies="master-only"/><br /> <allow-access-from domain="*"/><br /> <allow-http-request-headers-from domain="*" headers="SOAPAction"/><br /></cross-domain-policy>