|
CallServiceFromFlex
Example code that remotely invokes a Command and a Selection on a Service
IntroductionDetailsThe pocogese Flex framework provides a wrapper for the standard Flex HttpService to handle commands and selections. In particular, it handles FaultEvents for you which is explained in HandlingExceptionInFlex. Read the HttpClient API from the sources. ExamplesUse the pocogese HttpClient to call methods of your service Controller. public function testGetAllUsers():void {
var httpClient:HttpClient = new HttpClient("e4x")
httpClient.send_get("http://localhost:3000/user/service/getAllUsers", handleGetAllUsers)
}
public function handleGetAllUsers(data:XML):void {
trace("handleGetAllUsers:"+data)
}The following example uses the generated controller client UserControllerClient public function testGetAllUsers():void {
var uc:UserController = new UserControllerClient("http://localhost:3000/")
uc.getAllUsers(handleGetAllUsers)
}
|
Sign in to add a comment