HTTPService not reading updated xml, i've been having torefresh the xml in my browser manually

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default HTTPService not reading updated xml, i've been having torefresh the xml in my browser manually

    I am calling an HTTPService (id=data2php) which runs a php script which creates
    an xml doc and puts it on my server. i then call another HTTPService
    (id=feedRequest) which reads the xml doc. i then try to populate a datagrid
    with the lastResult of my HTTPService that reads the xml doc. My issue is that
    that the HTTPService which reads the xml doc reads the previous incarnation of
    the xml doc, not the newly created one that my HTTPService (data2php) created.
    i've been manually going to the xml doc in my browser and hitting refresh for
    my feedRequest HTTPService to read the updated xml.

    here is the mxml for the httpservice that reads the xml:
    <mx:HTTPService id="feedRequest"
    url="http://cfcdi.org/eric/dashboard/php/sales.xml" result="feedResult(event)"
    resultFormat="xml" useProxy="false"/>

    pretty straight forward.

    (actually, once in a while it will read the updated one)

    LittleMuscle Guest

  2. Similar Questions and Discussions

    1. After refreshing browser .as file loss updated value
      Hi Friend's 1. I have some problem in flex. I have two .mxml file and one .as file when i change value of a variable which i declared in .as file...
    2. Configuring DNS manually
      My colleagues here have installed a Win2K3 server while I was away and setup AD without installing DNS service on the server. So while running the...
    3. Datagrid not updated during delete, but updated during insert and update
      Hello everyone. A test webform here, single datagrid bound to one table through dataset, and controls to delete, update and insert data. The code...
    4. Imported + updated symbols don't stay updated
      Hi everybody. I apologize for posting a question that probably any newbie should know, but ... I'm a rank Fireworks newbie. My problem is that the...
    5. Shutting down manually
      Hi there, I have a .bat file that contains several steps that have to be done before the system gets shut down. at the end I would like to shut...
  3. #2

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    Hm, I don't see any reasons, which it should not return correct results.

    I do similar stuff in a component too an the server-side part gets updates on
    each reqeust.

    I suppose, you need to post more details, so that we may help further.

    justria Guest

  4. #3

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    LittleMuscle,
    Instead of binding to the lastResult property, I would explicitly handle the
    result and fault events of the HTTPService (the one that reads the newly
    created xml doc) and then manually update an XMLListCollection for use as the
    datagrid's dp. That way, you can at least walk through the debugger and see
    what's going on, and force the second HTTPService to read only when you're sure
    the newly created doc is ready.

    Since you said it works sometimes and not other times, it sounds like it's
    just a timing problem, sometimes the xml doc is created quickly enough that the
    HTTPService grabs the new xml doc, but if not, it's grabbing the old one. That
    would be my guess.

    jinx82002 Guest

  5. #4

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    I had a similar problem a while back. I never really found out what was
    causing the problem, but basically what was happening was that after the
    httpservice got one result, it would no longer function, regardless of anything
    I did to tell it to send again. The only thing that got it to work was
    changing the method to post, and adding a dummy post variable.

    Also, if the problem is the timing issue jinx is talking about, you might
    think about eliminating the feedRequest, and having the php script called by
    the data2php HTTPService return the xml file itself.

    ab1301 Guest

  6. #5

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    Yes, I experienced the same problem.

    Despite many suggestions about invalidating data, resetting the data provider,
    and so forth - the only - and I mean only - solution that worked was to send
    not only a "dummy" variable into each HTTP Service URL but to make sure that
    "dummy" variable was different between calls.

    Therefore, I get a new Date() object in milisecond format and send this into
    each of my URL data calls.

    Does the trick.

    ChrisBAH1008 Guest

  7. #6

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    dummy variable like this???

    <mx:HTTPService id="feedRequest"
    url="{'http://cfcdi.org/eric/dashboard/php/sales.xml?id='+Math.random()}"
    useProxy="false"/>

    or this

    <mx:HTTPService id="feedRequest"
    url="{'http://cfcdi.org/eric/dashboard/php/sales.xml?id='+Math.random()}"
    method="POST" useProxy="false"/>

    ?

    LittleMuscle Guest

  8. #7

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    No. Dummy variable like this:

    <mx:HTTPService id="userRequest" url="http://whatever.php" useProxy="false"
    method="POST">
    <mx:request xmlns=""> <dummyvariable>dummyvariable</dummyvariable>
    </mx:request>
    </mx:HTTPService>

    ab1301 Guest

  9. #8

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    You can do it either way, Muscle.
    ChrisBAH1008 Guest

  10. #9

    Default Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my browser manually

    Both should work, however if you are getting timeouts instead of error I think you should go with ab's one as it limits the connection and retrieves it at the same time.
    CHAOS'|nc. Guest

  11. #10

    Thumbs up Re: HTTPService not reading updated xml, i've beenhaving to refresh the xml in my bro

    Quote Originally Posted by ab1301 View Post
    No. Dummy variable like this:

    <mx:HTTPService id="userRequest" url="http://whatever.php" useProxy="false"
    method="POST">
    <mx:request xmlns=""> <dummyvariable>dummyvariable</dummyvariable>
    </mx:request>
    </mx:HTTPService>
    THANKS SO MUCH abc1301. IT WORKS!!!
    Khanh Tran Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139