1 Reply Latest reply on Jul 2, 2009 11:46 AM by paraglidersd

    Timeout in resultHandler for HTTPService request


      Hello All,


      I have a flex application where I am calling to get data in XML format.  The data file most likely will contain 10's of thousands of records (in most cases).  What I am experiencing is a timeout in my rHandle function (see code snippets below):


      Error #1502 A Script has executed for longer than the default timeout period of 15 seconds


      My question/problem has 2 parts.

      1) how do you disable the timeout?

      2) the reading/parsing of the XML data seems to take waaaay too long.  Is there a better way?


      I put an Alert message at the top of the result handler function and it didnt trigger before the timeout message triggered.  I am reading what could be 10's of thousands of records.  Is there a better (and FASTER) way to do this than to read in XML format?  Currently, no matter what I set the httpservice requests 'timeout' value to doesnt seem to have any effect.  I get a timeout after 15 seconds every time.  I have tried setting the timeout value to -1 (as documentation suggested) and/or to some very large value (say, 1200...20 minutes).  Any and all help is appreciated.   Here is the code and an example of the XML file


      private var contactService:HTTPService = new HTTPService();
      private var xData:XML;
      private var T_Data:ArrayCollection = new ArrayCollection();
      private function get_data():void
         contactService.format = "e4x";
         contactService.addEventListener(ResultEvent.RESULT, rHandle);
         contactService.requestTimeout = -1;


      private function rHandle(event:ResultEvent):void
         var i:int;


         xData = event.result as XML;


         for  (i=0; i < xData.el.length(); i++)
            var t:Object = new Object();
            t.cid = xData.el[i].cid; 
            t.date = xData.el[i].date; 
            t.y_axis = xData.el[i].y_axis;




            <mx:DateTimeAxis />
            <mx:LinearAxis />
            <mx:PlotSeries id=... yField="y_axis" xField="date" />




      contents of big_data.xml


      .........(10s of thousands of records like this)....