Are you sure that NewDataSet is an array?  Have you printed out the contents of the array to make sure the object structure is right?  Can you use the FlexBuilder debugger to put a breakpoint at the first line in resultHandler and inspect the value you’re about to assign?

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of brownd_92
Sent: Tuesday, November 29, 2005 3:29 AM
To: [email protected]
Subject: [flexcoders] Webservice not working! Any Ideas.

 

Hi there,
I have a webservice that returns an XML Document. I have followed
the examples in flex 2 to the letter and still cant get it to work!!

This is my MXML File:

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

<mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml"
    creationComplete="srv.logonXML1.send()">

    <mx:Script>

        import mx.collections.ArrayCollection;
        import mx.rpc.events.*;
        import mx.controls.Alert;

        [Bindable]
        public var catalog:ArrayCollection;

        private function resultHandler(event:ResultEvent)
        {
            catalog = new ArrayCollection
(srv.logonXML1.result.NewDataSet);
            //Alert.show("Webservice Fired!");
        }

        private function faultHandler(event:FaultEvent)
        {
            Alert.show(event.fault.faultstring, "Error requesting
data");
        }

    </mx:Script>

  <mx:WebService id="srv"
wsdl="http://localhost/bookingservice/Service.asmx?wsdl"
showBusyCursor="true"   result="resultHandler(event)"
fault="faultHandler(event)">
      <mx:operation name="ReturnString"/>
      <mx:operation name="logonXML1">
            <mx:request>
                <uname>"[EMAIL PROTECTED]"</uname>
                <upassword>"secura140"</upassword>
           </mx:request>
      </mx:operation>
</mx:WebService> 

    <mx:Tile>
        <mx:Repeater id="list" dataProvider="{catalog}">
            <mx:VBox>
                <mx:Label text="{list.currentItem.User_Name}"/>
            </mx:VBox>
        </mx:Repeater>
    </mx:Tile>

</mx:Application>


This is what my webservice returns:


  <?xml version="1.0" encoding="utf-8" ?>
<NewDataSet>
<login>
  <User_ID>1</User_ID>
  <User_Name>[EMAIL PROTECTED]</User_Name>
  <User_Password>dsadsad</User_Password>
  <User_Minutes>120</User_Minutes>
  </login>
  </NewDataSet>


Any Ideas why it wont show anything on the screen?

Thanks

David








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to