1 Reply Latest reply: Jul 10, 2013 8:09 AM by rtalton RSS

    How  do I diplay data from a webservice?

    Antonietta123 Community Member

      I tried to display data from a webservice but I get null back. Does anybody know how it works?

       

      private function init(): void

                                    {

                                              webService = new WebService();

                                              webService.addEventListener(LoadEvent.LOAD, onLoad);

                                              webService.addEventListener(FaultEvent.FAULT, onFault);

                                              webService.loadWSDL("http://gamepc06.fh-trier.de:8080/CFService.asmx?WSDL");

       

       

                                    }

       

                                    private function onLoad(event: LoadEvent):void

                                    {

                                              event.target.removeEventListener(LoadEvent.LOAD, onLoad);

                                              currentState = "login"

       

                                              //Test

       

                                              webService.getOperation("List").addEventListener(ResultEvent.RESULT,onResult);

                                              webService.getOperation("List").send();

       

       

                                    }

       

       

       

      private function onResult(event:ResultEvent):void

                                    {

       

                                              var collection:ArrayCollection = event.target as ArrayCollection

                                        list.dataProvider = collection

       

       

                                              list.labelField = "HostName";

                                    }