Tracey - thanks for the help. got it with this
private function getRBValueByAttribute(attributeName:String):String {
var soapNS:Namespace =
dataXML.namespace("SOAP-ENV");
var typNS:Namespace = dataXML.namespace("typ");
var body:XMLList = dataXML.soapNS::Body;
return body..typNS::entity.typNS::attribute.(@id ==
attributeName).children()[0];
}
cheers flexcoder you did it again :-)
martin
--- In [email protected], "Tracy Spratt" <tspr...@...> wrote:
>
> Unless your xml is very simple, you should not guess at the e4x
> expession, but rather work your way to the node you want by using
> temporary variables and tracing the results as you go.
>
>
>
> To do this you must use a resultHandler, and do not use lastResult.
> Start with something like:
>
> private function handleResult(event:ResultEvent):void
>
> var xmlResult:XML = XML(event.result)
>
> trace(xmlResult.toXMLString()); //CRITICAL step, verify your structure
>
>
>
> Then get the next node in the path you want, trace again, etc.
>
>
>
> Tracy Spratt
> Lariat Services
>
> Flex development bandwidth available
>
> ________________________________
>
> From: [email protected] [mailto:[email protected]] On
> Behalf Of m_ollman
> Sent: Wednesday, February 18, 2009 4:23 AM
> To: [email protected]
> Subject: [flexcoders] Re: parse SOAP response for values
>
>
>
> Tracy :-)
>
> Thought about the namespace issue - some examples where talking about
> the SOAP Header being removed automatically, I was'nt seeing that. The
> reult format is E4X. However I could not get into the structure using
> childNode etc.
>
> So I would start by defining the namespace it.
>
> <SOAP-ENV...
> typ="http://ruleburst.com/ruleserver/9.1/rulebase/types
> <http://ruleburst.com/ruleserver/9.1/rulebase/types>
>
> in AS
>
> public var typ:Namespace =
> new
> Namespace("http://ruleburst.com/ruleserver/9.1/rulebase/types
> <http://ruleburst.com/ruleserver/9.1/rulebase/types> ");
>
> Next step I'm not sure about the path to the attribute.
>
> WS.Assess.lastResult.typ::session-data.global.global_1.abc570.
>
> WS.Assess.lastResult.typ::assess-response.session-data.list-entity.entit
> y.abc570
>
> Will test in the morning when back at desk. Rushed out so fast I left
> my USB! doh
>
> Cheers
> martin
>
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Tracy Spratt" <tspratt@> wrote:
> >
> > One big hassle with SOAP is the namespaces. Once you get that
> straight,
> > you can use normal e4x expressions on it.
> >
> >
> >
> > Where are you having difficulty?
> >
> >
> >
> > Tracy Spratt
> > Lariat Services
> >
> > Flex development bandwidth available
> >
> > ________________________________
> >
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of m_ollman
> > Sent: Wednesday, February 18, 2009 12:38 AM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] parse SOAP response for values
> >
> >
> >
> > I have been looking around for a few hours - Flex Cookbook has some
> > info about mapping types. But no real method of getting into the
> > structure.
> >
> > I need to grab the value of an attribute - abc570, which will be EOPO
> > + 4 other attributes.
> >
> > <SOAP-ENV:Envelope
> > xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/>
> > <http://schemas.xmlsoap.org/soap/envelope/
> <http://schemas.xmlsoap.org/soap/envelope/> > "
> >
> > xmlns:typ="http://ruleburst.com/ruleserver/9.1/rulebase/types
> <http://ruleburst.com/ruleserver/9.1/rulebase/types>
> > <http://ruleburst.com/ruleserver/9.1/rulebase/types
> <http://ruleburst.com/ruleserver/9.1/rulebase/types> > ">
> > <SOAP-ENV:Header/>
> > <SOAP-ENV:Body>
> > <typ:assess-response>
> > <typ:session-data>
> > <typ:list-entity entity-type="global">
> > <typ:entity id="global_1">
> >
> > <typ:attribute id="abc570" inferencing-type="intermediate"
> type="text">
> > <typ:text-val>EOPO</typ:text-val>
> > </typ:attribute>
> >
> > ** ETC - 4 more vales **
> >
> > </typ:entity>
> > </typ:list-entity>
> > </typ:session-data>
> > </typ:assess-response>
> > </SOAP-ENV:Body>
> > </SOAP-ENV:Envelope>
> >
> > Handler is
> >
> > private function RBcompleteHandler(event:Event) : void
> > {
> >
> > var dataXML:XML = XML(event.target.data);
> > }
> >
> > any help much appreciated
> >
> > rgds
> > martin
> >
>