1 Reply Latest reply on Oct 7, 2009 12:18 PM by matthew horn

    Help required for HTTP service

    Arunkumar S Level 1

      Hi,

           I'm new to flex. The problem that am facing is as follows:

       

           My application is loading the data from .aspx page. For that what i have done is, i have created a HTTP service with the .aspx page named (Input.aspx). This Input.aspx will be generated dynamically using .net and the data are fetched from the Database.

          

           I'm reading these data from Input.aspx and have loaded into a DataGrid. This Datagrid is embeded in a aspx page called Main.aspx. In this page another one Menu.swf (Created using Flash) is also loaded (This swf is of type Menu structure). Whenever the user clicks an option from the Menu, some parameters will be passed to XYZ.aspx page from the Menu.swf. This XYZ.aspx page will fetch the data from database based on the parameter that it has received from the Menu.swf and will write the fetched data into the Input.aspx.

       

           In this process everything is working fine on the first time. If the user selects the someother option from the Menu.swf, the corresponding data is fetched from the DB and also written in the Input.aspx page. While deploying this in the server, My datagrid is showing the correct data from the Input.aspx. But at the second time (If some other option is selected from the Menu) its fetching the data from the Input.aspx which is available in the Local Temp file itself instead of fetching the data from the Input.aspx available in the Server.

       

           It would be a great help for me if some one could address the solution for this problem. Or is this the real functionality of HTTP service like fetching the data from the server for the first time and for rest of the times fetching the data from the Local itself?

        • 1. Re: Help required for HTTP service
          matthew horn Level 3

          Sounds like the first request is being cached and returned on subsequent requests. One way to avoid it is to create a new session in the target page. In PHP, you add something like this to the top of the page:

           

          session_start();

           

          That way each request will result in a new session and not be cached. In ASPX, I don't know what you do but hopefully that will help you get started.

           

          Another way to avoid getting cached results is to append a unique ID to the end of each request (such as the date/time in milliseconds).

           

          hth,

          matt horn

          flex docs