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
SpectrumGFASpectrumGFA 

Cannot Login using Flex Toolkit salesforce.mxml

The code:


private function login():void {

    var policyUrl:String = "http://www.salesforce.com/services/crossdomain.xml";
       
    Util.debug(this, "loading the policy file: " + policyUrl);
    Security.loadPolicyFile(policyUrl);


    var lr:LoginRequest = new LoginRequest;
    lr.server_url = Application.application.parameters.server_url;   
    lr.session_id = Application.application.parameters.session_id;
    lr.username = 'username@domain.com';
    lr.password = 'password';           
    lr.callback = new AsyncResponder(loginResult, loginFault);


    Util.debug(this, 'apex.login ( ' +ObjectUtil.toString(lr) +'\n);' );   
    apex.login(lr);

}

private function loginResult(result:Object):void {
    Alert.show("Success");
}

private function loginFault(fault:Object):void {
    Alert.show("Login error!");
}


It always goes straight to loginFault, and here is my error message:


Warning: Ignoring invalid <allow-access-from> tag for domain 'http://www3.stream.co.jp' in policy file at http://www.salesforce.com/crossdomain.xml
Warning: Ignoring invalid <allow-access-from> tag for domain 'http://salesforce.sitestream.com' in policy file at http://www.salesforce.com/crossdomain.xml

[FaultEvent fault=[RPC
    Fault faultString="HTTP request error"
    faultCode="Server.Error.Request"
    faultDetail="Error: [IOErrorEvent
                                        type="ioError"
                                        bubbles=false
                                        cancelable=false
                                        eventPhase=2
                                        text="Error #2032: Stream Error. URL: http://www.salesforce.com/services/Soap/u/9.0"].
    URL: http://www.salesforce.com/services/Soap/u/9.0"]
    messageId="FA86E4BC-40CE-E542-80D0-0F0DF9206919"
    type="fault"
    bubbles=false
    cancelable=true
    eventPhase=2]


I know this is from not having a crossdomain file, but even when I explicitly set one, it defaults to http://www.salesforce.com/crossdomain.xml and NOT http://www.salesforce.com/services/crossdomain.xml. 

Help? :(  
Ron HessRon Hess
the flex library sets the crossdomain file , not your code.

you are probably hitting an incorrect password or login challenge. 
you may need to add the login token to the password.

Also it looks like 9.0 API is from an older version of the flex library, which may be the problem.


Message Edited by Ron Hess on 02-12-2008 05:49 PM
SpectrumGFASpectrumGFA
I still cannot login and I can't even get my instance to generate a security token.
 
 

fault: [FaultEvent fault=[RPC Fault faultString="HTTP request error" faultCode="Server.Error.Request" faultDetail="Error: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: https://www.salesforce.com/services/Soap/u/11.0"]. URL: https://www.salesforce.com/services/Soap/u/11.0"] messageId="E462EEA2-B840-62F9-EB1A-13B6001E0932" type="fault" bubbles=false cancelable=true eventPhase=2]

prafullguptaprafullgupta

I am also getting the same error.

did you get any success on this?

jensenaxeljensenaxel

anybody care to chime in on this? I'm having the same issue... I'm using http, making sure to specify that, and setting the protocol to http.

 

loading the policy file explicitly, started by using the v9 api because that is what all the documentation uses as far as the hello world application, everything was working fine until i tried to upload it to a external server and run it... then started to get the crossdomain issues, and am in need of some help...

 

any advice is appreciated.

 

Axel