function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MotokiMotoki 

Flex Login failed

Hi I'm using the Flex toolkit for a flex application. I have everything working when i run the project locally but once i put it on a web server and try to access it from the server url, the connection to http://www.salesforce.com/services/Soap/u/9.0 fails. Can anyone please help me solve this please?
 
Thank you very much.
Ron HessRon Hess
what version do you have?
MotokiMotoki
I'm using the version R3_6 thanks!
Ron HessRon Hess
3_7 should be available, but i'm not sure what failure you are seeing.

do you have a trace or error message?
MotokiMotoki

Hi i just changed to using R3_7 but i still got the same sandbox error when i accessing from my web server's url. The error message is as follows:

(mx.rpc::Fault)#0
  errorID = 0
  faultCode = "Channel.Security.Error"
  faultDetail = "Destination: DefaultHTTP"
  faultString = "Security error accessing url"
  message = "faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination: DefaultHTTP'"
  name = "Error"
  rootCause = (flash.events::SecurityErrorEvent)#1
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#2
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#2
    text = "Error #2048: Security sandbox violation: http://localhost:8080/HBH1/bin/artist.swf cannot load data from http://www.salesforce.com/services/Soap/u/9.0."
    type = "securityError"

 

If i run this application locally using Flex Builder, everything works fine... i really have no idea what is happening... please help.

 

Many thanks.

Ron HessRon Hess
i see, the default protocol is https, which does not match your localhost

the secruity is picky this way.

you will have to set this on the connection object, here is the setter:

Code:
    /**
     * protocol to use, can be set to http, defaults to https
     * @return String
     * 
     */    
    public function get protocol():String {
     return this._protocol;
    }
  public function set protocol(prot:String):void {
     this._protocol = prot;
    }

 


so, whereever you create the Connection object, say it's called 'apex'

you would do

apex.protocol = 'http'

before login

good luck
MotokiMotoki
Thanks, I have added apex.protocol = 'http' before calling login(lr) and tried again but unforunately i still getting this... could you help please? many many thanks.
 
(mx.rpc::Fault)#0
  errorID = 0
  faultCode = "Channel.Security.Error"
  faultDetail = "Destination: DefaultHTTP"
  faultString = "Security error accessing url"
  message = "faultCode:Channel.Security.Error faultString:'Security error accessing url' faultDetail:'Destination: DefaultHTTP'"
  name = "Error"
  rootCause = (flash.events::SecurityErrorEvent)#1
    bubbles = false
    cancelable = false
    currentTarget = (flash.net::URLLoader)#2
      bytesLoaded = 0
      bytesTotal = 0
      data = (null)
      dataFormat = "text"
    eventPhase = 2
    target = (flash.net::URLLoader)#2
    text = "Error #2048: Security sandbox violation: http://localhost:8080/HBH1/bin/artist.swf cannot load data from http://www.salesforce.com/services/Soap/u/9.0."
    type = "securityError"
MotokiMotoki
I forget to mention I'm using the free developer account. would it be the reason that i couldn't connect this way??
 
Thanks.
MotokiMotoki
Don't worry, i got it thanks!
Ron HessRon Hess
what did you change to make it work?  
MotokiMotoki
I made a mistake in configuring the proxy-config.xml in my JRun server. Once i clear that up, the apex.procotol = 'http' works perfectly.
eyewelleyewell
Hello Ron,
 
I have the same error message.
I have tried versions 3.6 and 3.7.
I have tried the apex.protocol suggestion (both http and https values).
 
Is there a local config issue that could be getting in the way?
  • On my laptop I have successfully run the sample salesforce Flex application as well as my own custom app
  • Now, on my home desktop, on the same network on which I use the laptop, I am not able to run standalone swfs (not using a localhost app server). Both the out of the box sample and my own code give me the same error message.
The same code seams to run fine on one PC setup, but not on the other...
 
Can you think of a direction to point me in?
 
Erik
 
MotokiMotoki
Well, you could check if you have any error in the proxy-config.xml or other server settings or typing errors and such. At least thats what worked for me.
 
Good Luck mate!
jev007jev007
It would be helpful if you post the steps you took to finally figure this out.

Thanks