Right. I use the FlashBuilder Data Services too, but call them from Swiz controllers using ServiceHelper.
Originally Posted by ghillert
So, I never touch any of the classes generated by Flash Builder Data Services, which means if I need to change properties/methods on the server, I just delete/re-add the service(s) from Flash Builder.
Below is a simple example. userService is a Flash Builder Data Service that is automagically generated ala BlazeDS java introspection.
// Create User
[EventHandler( event="UserEvent.CREATE_USER_REQUESTED", properties="user" )]
public function createUser( user : User ) : void
serviceHelper.executeServiceCall( userService.createUser( user ), handleCreateUserResult, handleCreateUserFault );
private function handleCreateUserResult( event : ResultEvent ) : void
// Show an Alert just to make it obvious that the save was successful.
dispatcher.dispatchEvent(new UserEvent( UserEvent.CREATE_USER_COMPLETE ));
Alert.show( 'User saved successfully!' );
private function handleCreateUserFault( info:Object ) : void
dispatcher.dispatchEvent(new UserEvent( UserEvent.CREATE_USER_ERROR ));
Alert.show( 'Reason for failure: ' + info.fault.rootCause.message, 'User Save Failed' );