Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
LittleMuscle #1
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
-
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... -
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... -
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... -
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... -
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... -
justria #2
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
-
jinx82002 #3
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
-
ab1301 #4
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
-
ChrisBAH1008 #5
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
-
LittleMuscle #6
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
-
ab1301 #7
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
-
ChrisBAH1008 #8
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
-
CHAOS'|nc. #9
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
-



Reply With Quote


