Expand my Community achievements bar.

SOLVED

Problem in flex with cross-domain scripting using GET method

Avatar

Level 1
Hi,



I have a strange problem in Flex, calling scripts located at
other servers, using the GET method.



When I want to connect with a HTTPService in Flex, to a
script located on another domain than the flex application, I place
a crossdomain.xml at the root of the script-server:



<?xml version="1.0"?>

<!--
http://www.script-domain.com/crossdomain.xml
-->

<cross-domain-policy>

<allow-access-from domain="www.app-domain.com"/>

</cross-domain-policy>



The problem is that when using the GET method to the
cross-script, it seemes that the flashplayer append the lookup for
the crossdomain.xml at the end of the querystring. With an url
snooper I can se the url requested, and when the player looks for
the crossdomain.xml, it does it in a strange way:




http://www.script-domain.com?var1=val1&var2=val2/crossdomain.xml



It seems to use the url+querystring as url, and puts
crossdomain.xml in the end of the querystring, which is NOT the
location of it, and the app fails with a runtime error message.



The lookup for the crossdomain.xml should look like this:




http://www.script-domain.com/crossdomain.xml



If i use the POST method instead, it works fine, but I would
like to be able to use the GET method as well.



Any suggestions??



/Jesper
1 Accepted Solution

Avatar

Correct answer by
Level 1
Problem solved!



To get the crossdomain check working correct, you must
request the remote script itself and not just the remote folder:




http://www.remote-domain.com/script.php?va1r=val1&var2=val2



That's it!

View solution in original post

3 Replies

Avatar

Level 1
Problem solved!



To get the crossdomain check working correct, you must
request the remote script itself and not just the remote folder:




http://www.remote-domain.com/script.php?va1r=val1&var2=val2



That's it!

Avatar

Correct answer by
Level 1
Problem solved!



To get the crossdomain check working correct, you must
request the remote script itself and not just the remote folder:




http://www.remote-domain.com/script.php?va1r=val1&var2=val2



That's it!

Avatar

Level 1
Actually, a single slash after the url is enough:




http://www.remote-domain.com/



/Eklux