Mega Code Archive

 
Categories / Flex / Data Model
 

Web Service Fault Event

<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">   <mx:Script>            import mx.controls.Alert;       import mx.rpc.events.FaultEvent;       import mx.collections.ArrayCollection;       import mx.rpc.events.ResultEvent;              [Bindable]       private var contactData:ArrayCollection;              private function resultHandler(event:ResultEvent):void       {         contactData = event.result as ArrayCollection;       }       private function faultHandler(event:FaultEvent):void       {         Alert.show(event.fault.faultString, event.fault.faultCode);       }      </mx:Script>   <mx:WebService id="myService"      wsdl="http://localhost/Service.cfc?wsdl"     result="resultHandler(event)"     fault="faultHandler(event)"/>      <mx:Button label="Get Data" click="myService.noSuchMethod()"/>    </mx:Application>