Service load.\n"; var o:Object = {inputInteger:'A1'}; ops(o); MXUnitManager.delay = 6000; MXUnitManager.addTests(this,["Test_ValueOf_actualSOAPResponse"],10000); } private function onServiceFault(event:FaultEvent):void { trace("web service fault: " + event.fault.faultString); output.text += "-> Service fault: " + event.fault.faultCode + " - " + event.fault.faultString + ".\n"; } private function onFault(event:FaultEvent):void { trace("operation fault: " + event.fault.faultString); output.text += "FaultEvent: faultCode " + event.fault.faultCode + " faultString " + event.fault.faultString + ".\n\n\n\n"; actualSOAPResponse = event.fault.faultString; output.text += "actualSOAPResponse " + actualSOAPResponse + "\n\n"; } private function onResult(event:ResultEvent):void { trace("result: " + event.result); output.text += "event.result.varString " + event.result + "\n"; output.text += "-> Result: " + ObjectUtil.toString(event.result) + ".\n"; if(event.result != null){ output.text += "-> Passed \n"; }else{ output.text += "-> shound't be null " + event.result + ".\n"; } actualSOAPResponse = event.result; } private function ops(input:Object):void{ var lOperation:AbstractOperation= ws.getOperation("echoInteger"); lOperation.arguments.inputInteger = input.inputInteger; lOperation.addEventListener(ResultEvent.RESULT,onResult); lOperation.addEventListener(FaultEvent.FAULT, onFault); var op:Operation = lOperation as Operation; op.resultFormat = "object"; var lCall:AsyncToken = ws.echoInteger(); } // public test function public function Test_ValueOf_actualSOAPResponse():void { if(actualSOAPResponse != null){ Assert.isTrue(actualSOAPResponse == expectedSOAPResponse.toString() , expectedSOAPResponse.toString()); }else{ Assert.fail("not null"); } } ]]>