Skip to content

Instantly share code, notes, and snippets.

@joshbirk
Created November 9, 2011 17:30
Show Gist options
  • Save joshbirk/1352187 to your computer and use it in GitHub Desktop.
Save joshbirk/1352187 to your computer and use it in GitHub Desktop.
Flex RESTKit - login completely via SOAP and use REST callout
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