Highlighted

Problem with HTTPService

phthanh

16-11-2008

Hi all,

I'm having a problem with HTTPService

I have the file named "a.mxml" which contains a HTTPService
that calls to a url: "
http://localhost:8080/onlineshop.php".
This php file will read the MySQL database and return a result in
XML format. As you know, the file "a.mxml" will read this XML
result and display it on the webpage. But the problem is when I
move the "bin-debug" folder to another place rather than its
original place and I run the a.swf file (the result of the file
a.mxml), it can't access the MySQL database and sent an error
message:



"[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination:
DefaultHTTP"]

at mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\...

at
mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53]

at
mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest.as:103]

at
DirectHTTPMessageResponder/securityErrorHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messaging\channels\DirectHTTPChannel.as:368]

at flash.events::EventDispatcher/dispatchEventFunction()

at flash.events::EventDispatcher/dispatchEvent()

at flash.net::URLLoader/redirectEvent()"



I've added a crossdomain.xml file right in the bin-debug
folder, and I wrote this in that file:



<?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="
http://127.0.0.1:8080/"
secure="false"/> <!--i grant access to my local apache site
for the swf file-->

</cross-domain-policy>



but it still doesn't work

Do you guys have any ideas with this error?

Please help !

Thanks with regards

P/S: Please forgive for my bad English 🙂

Replies

Highlighted

atta707

16-11-2008

try putting your crossdomain.xml file at the root of your web
server. That is, in this case, it should be available at
http://localhost:8080/crossdomain.xml.



You might want to hit that URL in the browser to confirm that
you're indeed have placed the file at the right place.



ATTA
Highlighted

phthanh

16-11-2008

Thanks, ATTA. I've tried this before, but nothing happened

I summarize my problem: I have an swf file that can access to
MySQL database, but when I move that swf file to another place, it
no longer can access to the database. If anyone has experience with
this problem, please help !



Thanks a lot !
Highlighted

alice_data

17-11-2008

Hi,



I have similar problem before, but have you tried changing
the permission of the swf file to 755?



Another thing that you might want to check is, if you use
PHP or Perl, whatever language to access the database, those codes
need to be 755 for their permission too.



Hope this helps.



Alice
Highlighted