For the past couple days, I've been banging my head against a stupid SOAP server.
In my error logs, I was getting an exception / tracelog that looked like this: "Exception: (Widget, None, ), must be qref" -- (the key phrase being "must be qref").
First, I figured out that we had a rotten cache. So I disabled caching, yet, problems continued.
Second, I figured out that it's really the server's fault for failing to give me a proper WSDL, randomly; especially when using multiple worker instances. News flash - my server operator contact confirms a "server too busy" error in his logs. "Wunderbar!" Apparently, the server redirects to an HTTP 200 page when it should have provided an HTTP 503.
I was wondering how to be more graceful in handling these amazingly bad behaviours, and I actually came up with a useful, fairly generic solution. Posting here for future reference.
Something like this:
Used kind of like this: