I am calling the server method via HTTPService from the client side. The server is a RestFul web service and can respond with one of many HTTP error codes (say 400 for one error, 404 for another, and 409 for another). I tried to figure out a way to determine the exact error code sent by the server. I went through the entire object tree for the FaultEvent populated in my error handler, but no where it will tell me the error code. Is this missing functionality in Flex?
My code looks like this: HTTP service declaration:
<mx:HTTPService id="myServerCall" url="myService" method="GET" resultFormat="e4x" result="myServerCallCallBack(event)" fault="faultHandler(event)"> <mx:request> <action>myServerCall</action> <docId>{m_sDocId}</docId> </mx:request> </mx:HTTPService>
My error handler code looks like this:
private function faultHandler(event : FaultEvent):void { Alert.show(event.statusCode.toString() + " / " + event.fault.message.toString()); }
source share