My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
AuthenticationExample  
Create a connection with library
Updated Apr 22, 2011 by ludovic....@gmail.com
  • The following code show you an authentification example of as3 library

import com.ludovicbadin.elink.soap.LinkSession;
import com.ludovicbadin.elink.soap.events.FaultSOAPEvent;
import com.ludovicbadin.elink.soap.events.ResultSOAPEvent;

//Define SOAP API server
private var service:LinkSession = new LinkSession("http://yourserver.com/elinkapps/elink.dll/");
	
//Function to login		
private function login():void
{
        //Call login method
	LinkSession.login("login", "password", "alias");
        //Execute request with callback functions
	LinkSession.executeBatch(service, login_success, login_failed);
}

//Result callback function
private function login_success(event:ResultSOAPEvent):void
{
	if(event != null){
		event.stopImmediatePropagation();
		Alert.show("Connection successfull");
	}
}

//Fault callback function		
private function login_failed(event:FaultSOAPEvent):void
{
	if(event != null){
		event.stopImmediatePropagation();
		Alert.show(event.error.faultstring, event.error.faultcode);
	}
}
Powered by Google Project Hosting