2

My Flex application properly call a web service but it does not populate the drop down box.

Once I run the application the drop down box is empty.

my flex code is as following

<fx:Script>

    <![CDATA[
        import mx.controls.Alert;
        import mx.events.FlexEvent;

        protected function  
                    dropDownList2_creationCompleteHandler(event:FlexEvent):void
        {
            mycustomersResult2.token = hellos.mycustomers();
        }

    ]]> 
</fx:Script>

    <fx:Declarations>

    <hellos:Hellos id="hellos" fault="Alert.show(event.fault.faultString + '\n' 
             + event.fault.faultDetail)"
             showBusyCursor="true"/>

    <s:CallResponder id="mycustomersResult2"/>

</fx:Declarations>

 <s:FormItem label="Label">
  <s:DropDownList id="dropDownList2"
       creationComplete="dropDownList2_creationCompleteHandler(event)"
       labelField="age">
       <s:AsyncListView list="{mycustomersResult2.lastResult}"/>
  </s:DropDownList>
  </s:FormItem>
Jack Moore
  • 131
  • 2
  • 11
  • I have the same problem have you found any solution? – Saeed Pirdost Jan 12 '13 at 11:31
  • not yet, I am still looking for a solution :( – Jack Moore Jan 13 '13 at 22:15
  • Can you take a screenshot of flashbuilder in debug mode showing the contents of the lastresult object? I'd like to see how it's been serialized. Can we see your actionscript service code? ... blank out the url if you want. I ask because I want to see if you're using the right webservice class and which parameters you're passing it. – SpaceManGalaxy Jan 10 '13 at 06:16

2 Answers2

3

You don't need to use a server/network monitor while debugging this.

Just create a temporary const holding your XML code and work with it:

/*private static*/ const MY_XML:XML =
<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>Jack</name>
      </mycustomersReturn>
      <mycustomersReturn>
          <age>29</age>
          <name>Ben</name>
      </mycustomersReturn>
   </mycustomersResponse>
 </soapenv:Body>
</soapenv:Envelope>;

(yes, do not use any quotes above).

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
2

can you please check this line in the debug mode using watch expression?

mycustomersResult2.lastResult.mycustomersResponse

make sure your lastResult should have mycustomersResponse property.

Thanks, Dhiraj

powercoder23
  • 1,404
  • 1
  • 13
  • 22
  • I suppose it wont work because in xml hierarchy mycustomerreturn is under the mycustomersresponse, also based on the error message it does not find mycustomersResponse – Saeed Pirdost Jan 10 '13 at 06:48