Requesting Webservices in Flex 3
- Posted by kajyr on January 13th, 2009
- 5 Comments »
Follows Webservices, simple introduction.
In Flex 3 requesting data is really simple, since you really have to load a well know url which prints out XML (or JSON or whatever).
I assume you have read the introduction, here we are with a url that prints out informations about Cher’s top fans:
http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&artist=cher&api_key=xxxxxxxxxxxx
What we have to do is load that url with a mx:HTTPService Object and parse the result as XML. Simple, it isn’t?
First: create the HTTPService object:
GeSHi Error: GeSHi could not find the language mxml (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)
and the handlers
GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)
GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)
And oplà, in the data field you will have the returned xml, ready to be shown in your preferred component!