This sounds to me like the caching issue.

 

Are you using POST or GET method?  POST is not supposed to cache.

 

If you must use GET, append a unique string to each url.  Folks often
use Date.getTime()

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of valdhor
Sent: Tuesday, June 24, 2008 11:29 AM
To: [email protected]
Subject: [flexcoders] Re: calling and re-calling with httpservice

 

Have you tried using Charles (Or another HTTP Proxy) to make sure
another HTTPService call is actually being made?

I must recommend using Charles for any server data exchange debugging
- it is indispensable.

Also, it appears that Flex packages up requests and sends them to the
server together. Maybe that is biting you. Seth Hodgson explains it
better here:
http://tech.groups.yahoo.com/group/flexcoders/message/113808
<http://tech.groups.yahoo.com/group/flexcoders/message/113808> 

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "cscrum" <[EMAIL PROTECTED]> wrote:
>
> Here is a strange thing I ran into today. I have a program which 
> queries a DB through an aspx script called with httpservice. A user 
> clicks on a name, the query runs, and populates a form with data 
> from the database. The user can then edit the information and submit 
> the form to another script which makes changes to the DB. That is 
> all working except that when the user clicks on the same name again, 
> the old information is returned. I have verified that the DB is 
> being altered with the submit script. If I close the application and 
> reopen it and select the user again, then the modified data is 
> there. Is there something I am missing the httpservice call? I've 
> tried setting the array used for the result data to null. I even put 
> just a text field on the page and printed the results of the query 
> to it. It shows the old data too. It seems like it's not actually 
> running the query again like it should, but rather taking the values 
> from some place in memory until I close the app and reopen it. Any 
> ideas?
> 
> Relevant parts of my code are posted. 
> Attach Code 
> 
> <mx:Script> 
> <![CDATA[
> blah, blah. blah
> 
> 
> 
> 
> //function call to submit changes from customer form
> public function SendEditCust():void{
> //htmlres.htmlText = "sending data to ";
> CustEditHttpService.url 
> = "http://www.wispmon.com/editcustomer.aspx
<http://www.wispmon.com/editcustomer.aspx> ";
> CustEditHttpService.method = "GET";
> 
> var sndCEObj:Object = new Object();
> sndCEObj.w = wispid;
> sndCEObj.i = customer_id;
> sndCEObj.first = CustInfFirst.text;
> sndCEObj.last = CustInfLast.text;
> sndCEObj.address = CustInfAddress.text;
> sndCEObj.city = CustInfCity.text;
> sndCEObj.state = CustInfState.text;
> sndCEObj.zip = CustInfZip.text;
> sndCEObj.phone1 = CustInfPhone1.text;
> sndCEObj.phone2 = CustInfPhone2.text;
> sndCEObj.user = CustInfUser.text;
> sndCEObj.pass = CustInfPass.text;
> sndCEObj.email = CustInfEml.text;
> sndCEObj.notes = CustInfNotes.text;
> sndCEObj.cpeip = CustInfCpeIP.text;
> sndCEObj.oip = CustInfStatic.text;
> sndCEObj.tower = CustInfTower.text;
> sndCEObj.ap = CustInfSector.text;
> sndCEObj.rip = CustInfRouterIP.text;
> sndCEObj.lat = CustInfLat.text;
> sndCEObj.lon = CustInfLon.text;
> sndCEObj.mac = CustInfMac.text;
> sndCEObj.model = CustInfModel.text;
> sndCEObj.mfg = CustInfMFG.text;
> sndCEObj.type = "edit";
> if (CustInfSNMP.selected == true){
> sndCEObj.snmp = 1;
> }else{
> sndCEObj.snmp = 0;
> }
> sndCEObj.snmpc = CustInfSNMPCom.text;
> sndCEObj.snmpp = CustInfSNMPPass.text;
> if (CustInfMonitor.selected == true){
> sndCEObj.mon = 0;
> }else{
> sndCEObj.mon = 1;
> }
> sndCEObj.firm = CustInfFirm.text;
> CustEditHttpService.send(sndCEObj);
> }
> 
> public function getCEhttpResult(event:ResultEvent):void{
> Alert.show("Database Upadted 
> Successfully", "Success");
> 
> }
> 
> //HTTPService call to get customer/AP/Router/Link/Ticket 
> Data after clicking on label
> //public var svc:HTTPService = new HTTPService;
> 
> public function useHttpService():void {
> //service = new HTTPService();
> 
> userReq.url = dstURL;
> userReq.method = "GET";
> 
> var Obj:Object = new Object();
> Obj.w = wispid;
> Obj.i = tgtdata;
> userReq.send(Obj);
> }
> 
> //handler for useHttpService result
> [Bindable]
> private var response:ArrayCollection;
> 
> 
> public function gethttpResult(event:ResultEvent):void
> {
> 
> response = null;
> 
> //fill out form with results
> if (qtype=="Customers"){ 
> //check for single value in 
> returned XML 
> if 
> (event.result.SearchItems.customer is ObjectProxy){
> 
> 
> response = new 
> ArrayCollection([event.result.SearchItems.customer]);
> 
> ResultPane.selectedIndex=1;
> 
> }
> 
> CustInfFirst.text = response
> [0].c_fst;
> CustInfLast.text = response[0].c_lst;
> CustInfPhone1.text = response
> [0].phone;
> CustInfAddress.text = response
> [0].address;
> CustInfCity.text = response[0].city;
> CustInfState.text = response
> [0].state;
> CustInfZip.text = response[0].zip;
> CustInfEml.text = response[0].cemail;
> CustInfUser.text = response[0].user;
> CustInfPass.text = response[0].pass;
> CustInfNotes.text = response
> [0].notes;
> CustInfCpeIP.text = response
> [0].cpe_ip;
> CustInfStatic.text = response[0].oip;
> CustInfTower.text = response
> [0].tower;
> CustInfMac.text = response[0].mac;
> CustInfRouterIP.text = response
> [0].rip;
> CustInfSector.text = response[0].ap;
> CustInfLat.text = response[0].lat;
> CustInfLon.text = response[0].lon;
> CustInfSig.text = response[0].sig;
> CustInfSigt.text = response[0].sigt;
> CustInfModel.text = response
> [0].model;
> CustInfMFG.text = response[0].mfg;
> CustInfFirm.text = response[0].firm;
> CustInfSNMPCom.text = response
> [0].community;
> CustInfSNMPPass.text = response
> [0].s_pass;
> var snmp_state:String = response
> [0].snmp;
> if (snmp_state == "1"){
> CustInfSNMP.selected = 
> true ;}
> else {
> CustInfSNMP.selected 
> = false ;
> }
> 
> var cmon:String = response
> [0].monitor;
> if (cmon == "0"){
> 
> CustInfMonitor.selected = true;}
> else{
> 
> CustInfMonitor.selected = false;
> }
> var oticket:String = response
> [0].o_ticket;
> var cticket:String = response
> [0].c_ticket;
> 
> var opentkts:Array = oticket.split
> (",");
> var closedtkts:Array = cticket.split
> (",");
> OTkt.removeAllChildren();
> CTkt.removeAllChildren();
> if (opentkts.length > 0){
> for (var tkt:int = 0; tkt < 
> opentkts.length; ++tkt) {
> 
> labelxml = 
> new Label();
> labelxml.x = 10;
> labelxml.y = (tkt)
> *20;
> labelxml.id = "tkt" 
> + opentkts[tkt];
> 
> labelxml.text = opentkts[tkt];
> 
> labelxml.data = opentkts[tkt];
> 
> labelxml.setStyle("fontSize", 12);
> 
> labelxml.addEventListener(MouseEvent.CLICK, tktClickHandler);
> 
> labelxml.addEventListener(MouseEvent.ROLL_OVER, 
> lblOverHandler);
> 
> labelxml.addEventListener(MouseEvent.ROLL_OUT, 
> lblOutHandler);
> OTkt.addChild
> (labelxml);
> }
> }
> if (closedtkts.length > 0){
> for (var tktc:int = 0; tktc 
> < closedtkts.length; ++tktc) {
> 
> labelxml = 
> new Label();
> labelxml.x = 10;
> labelxml.y = (tktc)
> *20;
> labelxml.id = "tkt" 
> + closedtkts[tktc];
> 
> labelxml.text = closedtkts[tktc];
> 
> labelxml.data = closedtkts[tktc];
> 
> labelxml.setStyle("fontSize", 12);
> 
> labelxml.addEventListener(MouseEvent.CLICK, tktClickHandler);
> 
> labelxml.addEventListener(MouseEvent.ROLL_OVER, 
> lblOverHandler);
> 
> labelxml.addEventListener(MouseEvent.ROLL_OUT, 
> lblOutHandler);
> CTkt.addChild
> (labelxml);
> }
> }
> Alert.show("Values 
> Output", "Success");
> }
> blah, blah, blah
> 
> 
> ]]> 
> </mx:Script>
> 
> 
> 
> 
> <mx:HTTPService id="userReq" result="gethttpResult(event)" 
> fault="handleFault(event)" useProxy="false" method="GET" 
> resultFormat="object" />
> <mx:HTTPService id="CustEditHttpService" result="getCEhttpResult
>

 

Reply via email to