Ticket #426 (closed defect: fixed)
ElementTree serialized to ObjectProxy, not XML
| Reported by: | jhaislip | Owned by: | nick |
|---|---|---|---|
| Priority: | critical | Milestone: | 0.4 |
| Component: | Remoting | Version: | 0.4 |
| Keywords: | ElementTree, ObjectProxy, XML | Cc: | |
| Fixed in revision: | Branch: | ||
| Author: |
Description (last modified by thijs) (diff)
I recently setup pyAMF with mod_python. I wrote test services that return the various datatypes of interest (DateTime, List, Bool, etc). I then accessed those services from a Flex application and saw that the serialization into Flex data types was working (Date, Array, Bool, etc). All of the data types I tested worked as they are supposed to except for one: ElementTree.
In my service, I have:
from pyamf.remoting.gateway.wsgi import WSGIGateway import elementtree.ElementTree as ET def getXML(): root = Element("root") SubElement(root, "one") SubElement(root, "two") SubElement(root, "three") SubElement(root, "four") return root # Expose our services: services = { 'service.getXML': getXML } GatewayController = WSGIGateway(services)
Here is the Flex:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="center" verticalAlign="middle"> <mx:RemoteObject id="remoteObj" endpoint="http://localhost:80/services" destination="service" result="displayResult(event)" fault="remoteFault(event)"> </mx:RemoteObject> <mx:Button click="handleGetXML(event)" label="Get XML"/> <mx:Text id="result" width="100%" height="100%"/> <mx:Script> <![CDATA[ import mx.utils.ObjectUtil; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; private function displayResult(re:ResultEvent): void { result.text = ObjectUtil.toString(re.result) + "\n"; } private function remoteFault(fault:FaultEvent): void { result.text = ObjectUtil.toString(fault); } private function handleGetXML(evt:MouseEvent):void { remoteObj.getXML() } ]]> </mx:Script> </mx:Application>
When I access the service from Flex, it returns an ObjectProxy and not an XML.
Change History
Note: See
TracTickets for help on using
tickets.


