5 Replies Latest reply: Jul 15, 2009 7:15 AM by usercollection RSS

    flex faultstring

    Newsgroup_User Community Member
      Can anyone help me with this?
      I'm getting some error when open my flex compiled file on a server.. the swf
      works fine in the default directory of compilation, but if I move it .. I
      get this error:

      [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::faultHan
      dler()
      at mx.rpc::Responder/fault()
      at mx.rpc::AsyncRequest/fault()
      at ::DirectHTTPMessageResponder/securityErrorHandler()
      at
      flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFun
      ction()
      at flash.events::EventDispatcher/dispatchEvent()
      at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()


      This swf works ok in the default path, but if I upload the swf into a server
      it pulls this error.

      Thanx in advance.


        • 1. Re: flex faultstring
          _Albertx_ Community Member
          We have a Flex forum here.

          Well, Are you using Flex Data Services???

          Because I can see you're trying to get external data but with a URLLoader, or an AsynMessage or what are you using???

          It seems that it cannot find a destination
          • 2. Re: flex faultstring
            Rob_van_Galen Community Member
            I do have the same problem.
            I running my own server. On this server I'm running an webservice.
            When I call this webservice from my labtop it is running fine.
            But when I place the application on the webserver and call it by the browser on my labtop, I get the same error message.
            So Flex2 application en webservice on the same webserver result in this error

            Rob
            • 3. Re: flex faultstring
              Rob_van_Galen Community Member
              I solve my problem.
              I found on th web that I had to make a file named 'crossdomain.xml' and put it on the webserver.
              I put it in the same directory as my application.
              In this document you can put de names of the domains whare flash can savely get het data from. Flash will look for this file and load it by default.
              It looks like:
              <?xml version="1.0" ?>
              <cross-domain-policy>
              <!-- allow-access-from domain="www.mydomein.nl"/-->
              <allow-access-from domain="*.mydomein.nl" />
              <!-- allow-access-from domain="123.221.22.40"/ -->
              </cross-domain-policy>

              Rob
              • 4. Re: flex faultstring
                cliffy2009 Community Member
                Hi everyone,
                I really need help. I am trying to display username on a grid using php. And, everytime i run the program out of my server it doesn't work. can someone tell me what to do?
                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()
                at mx.rpc::Responder/fault()
                at mx.rpc::AsyncRequest/fault()
                at ::DirectHTTPMessageResponder/securityErrorHandler()
                at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
                at flash.events::EventDispatcher/dispatchEvent()
                at flash.net::URLLoader/flash.net:URLLoader::redirectEvent()
                Thanks
                • 5. Re: flex faultstring
                  usercollection Community Member

                  hi

                   

                   

                    iam new to flex

                   

                  iam using flex 3

                   

                  here is my code

                   

                  FLEX

                   

                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">   
                  <mx:Script>
                  <![CDATA[
                  import flash.system.Security;

                   

                  function logIn():void
                  {
                  userRequest.send();
                  }
                  function userCount(event:Object):void
                  {
                  //mx.controls.Alert.show(event.result.doc.user, 'Callback');
                  user.text = event.result.doc.user;
                  }

                   

                  function httpError(event:Object):void
                  {
                  mx.controls.Alert.show(event.toString(), 'Callback');
                  }
                  ]]>
                  </mx:Script>
                  <mx:Form width="200" height="255" id="form1" >
                  <mx:Panel width="128" height="143" layout="absolute" title="Test" id="panel1">
                  <mx:Text x="0" y="0" text="# user" width="108" textAlign="center"/>
                  <mx:TextInput x="25" y="20" width="58" height="20" id="user" editable="true" enabled="true" fontSize="10" color="#ff0000" textAlign="center" fontWeight="bold"/>
                  </mx:Panel>
                  <mx:Button label="Count" click="logIn()" id="button1"/>
                  </mx:Form>
                  <mx:HTTPService id="userRequest" url="htpp://localhost/flex/php/phpintegration-debug/functions.php" useProxy="false" method="POST" showBusyCursor="true" result="userCount(event)" fault="httpError(event.fault)" />

                   

                  </mx:Application>

                   

                   

                   

                  PHP CODE

                   

                   

                  <?php

                   

                  $server="localhost";
                  $user="root";
                  $pass="the@123";
                  $db="test";

                   

                  $link = mysql_connect($server, $user, $pass);
                  $ret = mysql_select_db($db, $link);

                   

                  $query = "SELECT count(*) as nb from login_new";
                  $result = mysql_query($query, $link);

                   

                  $nb=0;
                  while($row=mysql_fetch_array($result))
                  {
                  $nb += $row[0];
                  }
                  mysql_free_result($result);
                  mysql_close($link);

                   

                  $xml="<?xml version=\"1.0\" encoding=\"utf-8\"?><doc><user>".$nb."</user></doc>?>";
                  header("Content-Type: text/xml");
                  print($xml);
                  ?>

                   

                  and iam placing this code at localhost(means running at clientside)

                   

                  iam getting this error


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

                   

                   

                  please help me how to resolve it

                   

                  as iam new please say in step by step procedure

                   

                  its urgent please help me out

                   

                  thanks in advance