test").toString(); //xmldecode function called to decode returned xml public function xmlDecode(x : XMLNode) : Object { return {foo: 'bar'}; } //xmlencode function called to encode request parameters public function xmlEncode(o:Object) : XMLNode { return new XMLDocument("test"); } public function onServiceResult_xmlDecode(event:ResultEvent):void { resultXMLDecode = event.result; } public function onServiceResult_xmlEncode(event:ResultEvent):void { resultXMLEncode = StringUtil.trim(String(event.result)); } public function run():void { hsXMLDecode.send(); hsXMLEncode.send({foo:32, bar:'a string', baz: {a:1, b:32, c:'another string'}}); MXUnitManager.delay = 6000; MXUnitManager.addTests(this,["Test_xmlDecode","Test_xmlEncode"],10000); } public function Test_xmlDecode():void { Assert.isTrue(resultXMLDecode.foo == "bar", "result.foo should be 'bar'"); } public function Test_xmlEncode():void { Assert.isTrue(resultXMLEncode == expected, "result should be test"); } ]]>