Is it me or am I missing something...

In the example I notice your NOT calling the send() for the HTTP Service
And when I get a Object Object back I generally look into the dot(.)
notation to make sure I have it set to the right level

Exam: if not category.result try category.result.data etc...

Another way to handle it is to drop the results into a model and use the
model. 
Be sure to add the Array utility to the results or you'll be searching
forever to find a way to get all the data to present itself

JT 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Jeff Houser
Sent: Sunday, December 18, 2005 4:07 PM
To: [email protected]
Subject: [flexcoders] HTTPService and XML

 ( I also posted this on the labs forums at Macromedia.com, so I
apologize if this is a cross post for anyone )

 I'm using Flex Builder 2 (Alpha, of course) and am having trouble
retrieving / accessing XML data.

 I'm completely new to Flex, but know web programming well. I
succesfully implemented the quick start demos without any problem. My
long term goal is to populate a combobox from an XML document. I know
there is another post on the lab forum on that, but I haven't gotten
far enough to be able to apply that post.

I set up this quick demo to demonstrate the problem:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"; xmlns="*">
<mx:HTTPService id="category"
url="http://www.jeffryhouser.com/flex/getcategories.cfm";
useProxy="false"/>

<mx:Canvas width="100%" height="100%">
<mx:Label x="12" y="24" text="{category.result}" width="253"/>

</mx:Canvas>
</mx:Application>

 The label is blank. I would have expected it to return something like
"object Object", which makes me think that the problem is in
retrieving the data. If I add a similar label to the BlogReader quick
start code, "object Object" is returned, like this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml";
xmlns="*" initialize="feedRequest.send()" >
<mx:HTTPService id="feedRequest"
url="http://www.jeffryhouser.com/rss.cfm?mode=short"; useProxy="false"/>
<mx:Canvas width="100%" height="100%">
<mx:Label x="20" y="10" text="{feedRequest.result.rss.channel.title}" />
<mx:Label x="331" y="9" text="{feedRequest.result}" width="330"/>
<mx:DataGrid x="20" y="40" id="dgPosts" width="400"
dataProvider="{feedRequest.result.rss.channel.item}">
<mx:columns>
<mx:DataGridColumn headerText="Date" columnName="pubDate" width="150" />
<mx:DataGridColumn headerText="Posts" columnName="title"/>
</mx:columns>
</mx:DataGrid>
<mx:TextArea x="20" y="204" width="400"
htmlText="{dgPosts.selectedItem.description}" height="200"/>
<mx:Link x="24" y="405" label="Read Full Post" height="20"
click="getURL(dgPosts.selectedItem.link);" />
</mx:Canvas>
</mx:Application>


Now, If I take my first example and replace the HTTPService URL to
point to an RSS feed; nothing is returned; here is that code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"; xmlns="*">
<mx:HTTPService id="category"
url="http://www.jeffryhouser.com/rss.cfm?mode=short"; useProxy="false"/>
<mx:Canvas width="100%" height="100%">
<mx:Label x="12" y="24" text="{category.result}" width="253"/>
</mx:Canvas>
</mx:Application>

I do not see any differences, in technique, between the BlogReader and
the Test code; so I'm not sure why nothing appears to be getting returned.

Any thoughts or assistance would be welcome. 






--
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



 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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/
 


Reply via email to