?
Solved

Calling webservice in flex3.0

Posted on 2009-04-22
4
Medium Priority
?
286 Views
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.
0
Comment
Question by:jdpositive
3 Comments
 
LVL 12

Accepted Solution

by:
lexxwern earned 2000 total points
ID: 24211191
0
 
LVL 3

Expert Comment

by:chrisP4D
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"
       creationComplete="grabXML()">

      <mx:Script>
            <![CDATA[
                  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{
            
                        httpService.send();
                        
                        
                        
                  }

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

                  
            ]]>
      </fx:Script>      
      

            <mx:HTTPService id="httpService" showBusyCursor="true"
                                    resultFormat="e4x" url="music.xml"
                                    fault="Alert.show(event.fault.faultString,'Error')"
                                    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:columns>
                                    <mx:DataGridColumn headerText="Band" dataField="@band"   />
                                    <mx:DataGridColumn headerText="Album" dataField="@album"/>
                                    <mx:DataGridColumn headerText="Song" dataField="@title"/>
                              </mx:columns>
                              </mx:DataGrid>
      

</mx:VBox>

      
</mx:Application>
0
 
LVL 29

Expert Comment

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

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