Created
November 9, 2011 17:30
-
-
Save joshbirk/1352187 to your computer and use it in GitHub Desktop.
Flex RESTKit - login completely via SOAP and use REST callout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function login():void { | |
var lr:LoginRequest = new LoginRequest(); | |
lr.username = 'YOUR USERNAME'; | |
lr.password = 'YOUR PASSWORD'; | |
lr.callback = new com.salesforce.AsyncResponder(doQuery,showError); | |
force.login(lr); | |
} | |
private function doQuery(result:LoginResult):void { | |
rest = new RESTConnection(); | |
rest.setSession(result.sessionId,result.serverUrl); | |
rest.query("SELECT ID, Name from Contact LIMIT 5",new mx.rpc.AsyncResponder(queryHandler,com.force.utility.util.genericError)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment