Yeah, I really suspect the problem is on the server side.  I don't recall
specifically using 4 or more levels of xml, but I would be very surprised if
the e4x implementation had a problem like that.  You plan to test it is a
good one.

 

A question: You say you are HTTPService, but are also using SOAP?  SOAP is
typically used with WebService calls.  Are you manually building a SOAP
message and then sending it using the HTTPService protocol?  Is the SAP web
service layer is a standard SOAP web service implementation, why are you not
using WebService?

 

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: [email protected] [mailto:[email protected]] On
Behalf Of bhaq1972
Sent: Friday, January 08, 2010 4:44 AM
To: [email protected]
Subject: [SPAM] [flexcoders] Re: Problem Casting an Object to a known type

 

  

Hi Nick
If the returned object has 3 nested levels its xml but if it 4 nested levels
its not?

Do you use flexbuilder debugger? It might be worth putting a breakpoint at
the point where you return from the httpservice....and examining it. It
might not be a object which can be typecasted to ContactPerson().

Are you sure its a Compiler error or was it a Runtime error?

Bodrul

--- In flexcod...@yahoogro <mailto:flexcoders%40yahoogroups.com> ups.com,
Nick Middleweek <n...@...> wrote:
>
> Hello...
> 
> We've just run into a problem... Has anyone else come across this before?
> 
> We're making HTTP Service calls and we're getting back nested data. We
have
> set the resultFormat="e4x" which we then parse into known Object types,
such
> a IContactData, IInvoiceDetails...
> 
> The Problem: With some service calls, the data returned has 4 or more
levels
> of nested data. In these cases, Flex isn't giving us XML. It is just
> returning an untyped Object with the nested data.
> 
> If the returned data has 3 levels or less of nested data then we get XML.
> 
> 
> We then thought, ok... The untyped Object returned by Flex does have all
the
> properties required to Cast it to our typed Object, e.g. IContactData...
> 
> But we are getting a "Coercion failed" message by the Compiler. Here's a
> basic example of the problem...
> 
> 
> var myPerson : Object = new Object();
> myPerson.age = "25";
> myPerson.sex = "dunno"
> myPerson.name = "Nick";
> 
> 
> var myContact : ContactPerson = new ContactPerson();
> myContact = ContactPerson(myPerson);
> // Where ContactPerson is a typed Object with age, sex and name String
> properties.
> 
> 
> 
> So has anyone managed to solve the 4 levels of nested data problem from an
> HTTP Service call?
> 
> and :)
> 
> Why can't we cast an untyped Object into a typed Object? :)
> 
> 
> Cheers guys...
> 
> Nick
>



Reply via email to