views:

1115

answers:

3

Hi there.

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?

+1  A: 

To answer your question:

With the Remoting Service, you often use an AMFChannel. The AMFChannel uses binary AMF encoding over HTTP. If binary data is not allowed, then you can use an HTTPChannel, which is AMFX (AMF in XML) over HTTP.

and

http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/io/amfx/package-summary.html

The data format of RemoteObject is binary AMF so maybe you should use the WebService or HTTPService class instead if you want to work with XML (AMF would be faster; perhaps you lose the speed if you work with XML - not sure about AMFX).

LiveCycle also seems to have a similar serializer:

http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/javadoc/flex/messaging/io/amfx/package-detail.html

Hope some of that mess helps.

Typeoneerror
+3  A: 

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.

James Ward
That's a good idea. For some reason, I didn't think to return a String and create the XML from it. That's much better than my current workaround, which was using an HttpServlet.
DyreSchlock
A: 

looking for somethign similar.......I have data in xml format in flex side but I need to filter this data depending upon user input text box............any one ???

mohd
Filter it how? You should make a new Question for this.
DyreSchlock