Search code examples
xmlapache-flexblazedse4xremoteobject

How Can I get Remote Objects to return XML in E4X?


I'm writing a Flex application that makes full use of BlazeDS to a Java server. I use Remote Objects a lot, but I've come across an instance where receiving XML is cleaner and faster than returning objects.

Returning XML through BlazeDS is easy enough. I'm building up the XML with Dom4j on the Java and returning the root element through the BlazeDS service. BlazeDS translates the Dom4j objects into XML for me.

When receiving this objects on the Flex side, there are all ObjectProxy objects rather than XML. I've seen this before in a HttpService call, and to fix that I changed the resultFormat to E4X.

However, I cannot set a resultFormat on a RemoteObject service call.

Is there anyway I can convert these ObjectProxies into the E4X formatted XML?


Solution

  • Also, if you return XML either as a String or as some formal XML type then you can convert that to an XML object on the client side in Flex.