I have never used Flex before, but it was easy to create a sample
program that interprets JSON data from a DOR server.
I used this additional library:
http://code.google.com/p/as3corelib/
and take a look here:
http://ntt.cc/2008/10/06/as3corelib-tutorial-how-to-use-json-class-in-flex.html
With Flex, data controls can automatically render xml, so you could
automatically create an xml view from superobject in the Dor Server.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="
http://ns.adobe.com/mxml/2009"
xmlns:s="library://
ns.adobe.com/flex/spark"
xmlns:mx="library://
ns.adobe.com/flex/mx">
<fx:Script>
<![CDATA[
import com.adobe.serialization.json.JSON;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
import mx.utils.ObjectUtil;
private var srv:HTTPService
protected function button1_clickHandler(event:MouseEvent):void
{
srv = new HTTPService();
srv.url = "
http://server/controller/action.json";
srv.method = "GET";
srv.resultFormat = "text";
srv.addEventListener("result", httpResult);
srv.addEventListener("fault", httpResult);
srv.send();
}
public function httpResult(event:ResultEvent):void {
var result:Object = JSON.decode(event.result.toString());
memo.text = JSON.encode(result);
}
public function httpFault(event:FaultEvent):void {
var faultstring:String = event.fault.faultString;
Alert.show(faultstring);
}
]]>
</fx:Script>
<s:Button x="55" y="58" label="Button"
click="button1_clickHandler(event)"/>
<s:TextArea id="memo" x="44" y="116" width="374" height="221"/>
</s:WindowedApplication>