Peter, Thanks! But I'm not using the results in a Tree or Grid, which seem to have some magical parsing happening inside for you. I just want to do something as simple as pulling a node value out of the incoming SOAP wrapped XML and using it in, say, a TextArea. But... the following doesn't work...
<mx:TextArea text="{MyService.myOperation.lastResult.people.person.firstname}" /> nor does MyService.myOperation.lastResult.people.person[0].firstname MyService.myOperation.lastResult.person.firstname MyService.myOperation.lastResult.person[0].firstname or any other pattern I've tried. Amy suggested referencing the path all the way from the root node of the SOAP packet itself and treating the entire SOAP message as a bix XML result, instead of just the node path of the result. Something like... MyService.myOperation.lastResult.myOperationResult.people.person.firstname but I couldn't get that to work either. Darren >From: "Peter Watson" <[EMAIL PROTECTED]> >Reply-To: flexcoders@yahoogroups.com >To: <flexcoders@yahoogroups.com> >Subject: RE: [flexcoders] How to cast a WebService lastResult when CFC >returnType="xml" >Date: Wed, 23 Aug 2006 07:29:48 -0700 > >Darren, > >If your XML nodes have attributes (ie. <node label="foo"></node>) - you >can use the 'labelField' attribute to control the labels. > > <mx:Tree id="myTree" labelField="@label"/> > >If they don't (ie. <foo>bar</foo>) - or if you want to do any sort of >custom label logic, you need to use the 'labelFunction' attribute to set >the values appropriately. > ><mx:Tree id="myTree2 labelFunction="myLabelFunc"/> > > public function myLabelFunc (item:XML):String{ > > //if node has children > > if(item.children().toString() != >''){ > > return item.name(); > > } > > //no children, it's a leaf so get >the value > > else{ > > return >item.toXMLString(); > > } > > } > > > > > >regards, > >peter > > > > > >________________________________ > >From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On >Behalf Of Darren Houle >Sent: Monday, August 21, 2006 4:33 PM >To: flexcoders@yahoogroups.com >Subject: RE: [flexcoders] How to cast a WebService lastResult when CFC >returnType="xml" > > > >Bump?? > >Darren > > >From: "Darren Houle" <[EMAIL PROTECTED] <mailto:lokka_%40hotmail.com> > > > >Reply-To: flexcoders@yahoogroups.com ><mailto:flexcoders%40yahoogroups.com> > >To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> > >Subject: [flexcoders] How to cast a WebService lastResult when CFC > >returnType="xml" > >Date: Fri, 18 Aug 2006 23:08:44 -0400 > > > >I have a ColdFusion Component (web service) that looks like... > > > ><cffunction name="getEmployees" access="remote" output="false" > >returntype="xml"> > > <cfxml variable="myxml"> > > <people> > > <person> > > <firstname>John</firstname> > > <lastname>Smith</lastname> > > <job> > > <title>Doctor</title> > > <description>blah blah blah</description> > > </job> > > </person> > > <person> > > <firstname>Jane</firstname> > > <lastname>Doe</lastname> > > <job> > > <title>Lawyer</title> > > <description>blah blah blah</description> > > </job> > > </person> > > </people> > > </cfxml> > > <cfreturn myxml> > ></cffunction> > > > >and some Flex code that looks like... > > > ><?xml version="1.0" encoding="utf-8"?> > ><mx:Application > > xmlns:mx="http://www.adobe.com/2006/mxml ><http://www.adobe.com/2006/mxml> " > > creationComplete="TestService.getEmployees.send();"> > > <mx:WebService id="TestService" wsdl="http://localhost/hr.cfc?wsdl ><http://localhost/hr.cfc?wsdl> "> > > <mx:operation name="getEmployees" /> > > </mx:WebService> > > <mx:Tree > > id="myTree" > > width="50%" > > height="50%" > > showRoot="false" > > dataProvider="{TestService.getEmployees.lastResult}"/> > ></mx:Application> > > > >But what I get is a Tree that looks like: > > > >Flex doesn't seem to be able to extract the XML from the SOAP message, > >which > >is just SOAP XML wrapping my XML data. > > > >Changing the Operation's resultFormat from "e4x" to "xml" to "object" > >changes the amount of junk in the Tree, but doesn't fix the problem. As >a > >matter of fact, it works best when I leave off this attribute and let >the > >Operation decide what resultFormat to use. > > > >Casting lastResult as XML or XMLList doesn't seem to help either, and > >neither does > >ArrayUtil.toArray(TestService.getEmployee.lastResult) > > > >Is there something I need to do to the lastResult to get it to work in > >Trees, DataGrids, etc? Like cast it as some other data type? Why >doesn't > >e4x parse the SOAP message properly and extract my XML? > > > >Just about every example I can find out there shows people using > >HTTPService > >to pull back just the XML data without the SOAP webservice stuff, or >else > >shows how to create XML inside the mxml code itself using <mx:XML> but >I > >can > >find nothing that shows how to return XML from a CFC web service and > >use/parse it in Flex properly (as easy as, say, a CFC that returns a >Query > >object.) > > > >Darren -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/