Calling webservice in flex3.0

Posted on 2009-04-22
Medium Priority
Last Modified: 2012-05-06
Can anyone tell me the steps to call the webservice using flex3.0.Webservice is written in java and populate the datagrid of flex.
Question by:jdpositive
LVL 12

Accepted Solution

lexxwern earned 2000 total points
ID: 24211191

Expert Comment

ID: 35880750
this should help you out...its assuming your webservice is giving back xml.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"

                  import mx.collections.ArrayCollection;
                  import mx.collections.XMLListCollection;
                  import mx.controls.Alert;
                  import mx.rpc.events.FaultEvent;
                  import mx.rpc.events.ResultEvent;
                  import mx.utils.ObjectUtil;

                  public function grabXML():void{

                  [Bindable] private var dp:XMLListCollection;

                  private function httpService_result(evt:ResultEvent):void {
                        dp=new XMLListCollection(evt.result.song as XMLList);

                        //the fields in my xml being returned are band, album and title


            <mx:HTTPService id="httpService" showBusyCursor="true"
                                    resultFormat="e4x" url="music.xml"
                                    result="httpService_result(event)" />


            <mx:VBox horizontalAlign="center" verticalAlign="top" width="100%" height="100%">

                        <mx:DataGrid id="songList" labelField="title" dataProvider="{dp}"  width="100%" height="100%"  
                                       selectionColor="#AAAAAA" borderStyle="none" borderVisible="false">
                                    <mx:DataGridColumn headerText="Band" dataField="@band"   />
                                    <mx:DataGridColumn headerText="Album" dataField="@album"/>
                                    <mx:DataGridColumn headerText="Song" dataField="@title"/>


LVL 29

Expert Comment

ID: 37499035
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Most folks would know the basics of how Dropbox works, so that’s not the purpose of this article. Security is what it’s all about, so here I’ll share how I choose to secure my Dropbox Account and the Data it contains.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question