Hi
I
think you are missing the point of automated conversions of flex .
you
already have your soap method that can return objects - why return a string and
then go to objects again.
just
return objects (in a certain structure) - flex will do the
rest.
believe me i struggled for 3 days to get this result and not get into
objects->XML-->objects conversions. ( i know flex do it , so do u need to
:-)
for
example
class
Ticket{
int ticketID;
String label;
}
class
TicketContainer{
Ticket[] tickets;
}
The
WebService is something like this.
public
TicketContainer someWSmethod(){
Ticket t = new Ticket(1,"label1");
Ticket t1 = new
Ticket(2,"label2");
Ticket t2 = new
Ticket(3,"label3");
TicketContainer cont = new
TicketContainer(); // you must have a root node (top level)
object that contains array of
childs.
cont.addTicket(t);
cont.addTicket(t1);
cont.addTicket(t2);
return cont;
}
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Erik Westra
Sent: Friday, April 22, 2005 10:46 AM
To: [email protected]
Subject: RE: [flexcoders] string to xml -> datagrid
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.parseXML(str);
Greetz Erik
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Tracy Spratt
Sent: donderdag 21 april 2005 18:34
To: [email protected]
Subject: RE: [flexcoders] string to xml -> datagrid
It is "better" to use the createXML() utility function because it tells
the parser to ignore whitespace. If you have carriage returns in your
xml string and do not tell the compiler to ignore whitespace, the xml
will not work well with the tree control.
Tracy
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Erik Westra
Sent: Wednesday, April 20, 2005 7:51 AM
To: [email protected]
Subject: RE: [flexcoders] string to xml -> datagrid
To create XML from a string u can just do this:
var xml:XML = new XML(str);
Then u can use an xmlToObject coverter to convert the xml object to an
object wich consists of arrays and objects. I believe there is a
macromedia utility available for this.
Greetz Erik
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of core_elements
Sent: woensdag 20 april 2005 13:41
To: [email protected]
Subject: [flexcoders] string to xml -> datagrid
Hi I don't know if this is possible.
I have an soap-function that returns a string. The content of the
string:
<tickets><ticket><ticketID>1</ticketID></ticket><ticket><ticketID>2</
ticketID></ticket></tickets>
Of course this is just a string. Is it possible to convert the string to
an xml object and then bind that object to a datagrid?
I did found this :
var xmlStr:String;
xmlStr=ticketsService.getTickets.result;
var xml:XML;
xml=mx.utils.XMLUtil.createXML(xmlStr);
but I don't know if this is the right way ...
Yahoo! Groups Links
Yahoo! Groups Links
Yahoo! Groups Links
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
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 the Yahoo! Terms of Service.

