I'm having a heck of a time here, and I really have no idea what to do.
I have a proprietary server application that needs managing. Up until this point, while the server was under development, I was opening a port and connecting an AIR application using XMLSocket. That was working fine, up to the limitations of the simplistic exchange protocol we had in place, but as we moved towards final product, we rewrote that protocol, closed off the port to everybody but the local host, and wrote a python server to communicate with that port, with the idea that the python code would be able to be shared with 1) command-line utilities on the box and 2) a python-based web server that would expose a more robust API via SOAP. So now we're running CherryPy and soaplib, and I'm busily trying to rewrite the AIR app and bring it up to production quality.
It looked so easy on paper. And it even seemed pretty easy at the start. Pull down the "Import wsdl...", point it at my server, and wham-bang, tons and tons of code for blabbering back and forth. (It's worth noting at this point that the performance demands of the application are very low, and we shouldn't be doing more than a request or two a second.) And with a little bit of wrangling, that seemed to be what was happening.
But then I moved to actually trying to implement the application. Here's the basics of how it's supposed to work: one object polls for data from the server. There are several different types of data that it's pulling down, so it has to issue four requests to get the full set. I set a Timer to go off every four seconds to issue the requests.
Problem the first: when I had the code issue all four requests in sequence, the system would eventually halt (error #2032) at the same point (62 requests in, although that included my authentication requests). Also, it didn't seem to be sending all the requests; at least, my pending queue was filling up. So I figured that some internal queue was filling up, and requests were only getting popped off one at a time.
Try it this way: now my timer pops every second, but issues only one request at a time. OK, that worked. It'd poll indefinitely.
Oh, but now, problem the second: if I hold down the mouse button, say, to resize the screen, the requests start piling up again. What's more, and this is the funky thing: if I shut down the entire application and start it up again, now my initial authentication checks fail the first time through. Why? Because they are getting RESPONSES FROM THE LAST SET OF REQUESTS. Argle-flargle-klabble!
In fact, now that I start checking the data, everything is just plain screwed-up. I'm consistently getting callbacks fired on AsyncTokens that are totally unrelated to the data in the response. I.e., I have four resources I'm polling: call them AM, CM, PM, and VM, and four RPCs, list_AM, list_CM, list_PM, and list_VM. I call into the CAWebService for an AsyncToken for, say, list_AM. I call token.AddEventListener("result", handleResult). When handleResult fires on that token, everything looks right: the token contains the right event, the right response type, and the correct ID (set by me when I get the token). But when I actually look at the data in the token.response, well, it contains the response to a list_VM call.
I'm lost. I can't figure out what to do. I've reloaded the WSDL dozens of times. I've checked the web server over and over: whenever the requests are issued one at a time via test applications, the data comes back perfectly. I could rewrite the soap API to include a unique token, as I did in the original XMLSocket implementation, but that still doesn't solve the problem of requests getting dropped.
What can possibly be going on? What kinds of things can I do to figure out what's going on?
And most importantly, can anybody tell me a magic word to use to fix my problem? ("Oh, yeah, you needs to set the AbstractWebService.imadummy flag to true. That'll reconfigure the wsdl abstraction to generate the fluxCapacitor flag, thus generating the 1.21 gigawatts of energy necessary to fry your brain so that you can stop worrying about this stuff and finally get some sleep.")