0 Replies Latest reply on Jan 13, 2013 8:25 PM by Emertana

    My flex code does not parse SOAP Response

    Emertana

      I have the following code to populate the drop down box but it does not,

      once the application is run the dropdown box is empty, I used many different methods but neither works. (I deleted the flex generated tags such as declarations for simplicity)

       

       

           <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

                                       xmlns:s="library://ns.adobe.com/flex/spark"

                                       xmlns:mx="library://ns.adobe.com/flex/mx"

                                       xmlns:components="components.*"

                                       xmlns:hellos="services.hellos.*"

                                       height="957"  creationComplete="initApp()" >

       

       

          [Bindable]

          public var customers:ArrayCollection;

       

       

                   private function initApp():void

                                    {

                                               myService.mycustomers();

       

                                    }

       

                                    protected function myService_resultHandler(event:ResultEvent):void

                                    {

                                              customers  = event.result as ArrayCollection;

                                    }

       

       

       

       

       

       

       

       

                   <s:WebService id="myService"

                                         wsdl = "http://localhost:8081/WebServiceTest/services/Hellos?wsdl"

                                         result="myService_resultHandler(event)"/>

       

       

       

       

       

               <s:FormItem label="Employee:">

                                    <s:DropDownList id="dropDownList3"

                                                                            dataProvider="{customers}"

                                                                            labelField="name"/>

               </s:FormItem>

       

       

      SOAP response that I found in network monitor is as following

       

       

          <?xml version="1.0" encoding="UTF-8"?>

          <soapenv:Envelope

            xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

            xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

            <soapenv:Body>

              <mycustomersResponse xmlns="http://Services.com">

                <mycustomersReturn>

                  <age>28</age>

                  <name>John</name>

                </mycustomersReturn>

                <mycustomersReturn>

                  <age>29</age>

                  <name>Ryan</name>

                </mycustomersReturn>

              </mycustomersResponse>

            </soapenv:Body>

          </soapenv:Envelope>