Monthly Archives: July 2009

Interesting HTTPService Feature!

Several hours later I have finally discovered why my RESTful HTTPService call via BlazeDS was never returning a response*. Well it turns out that it actually was…

Thanks to the Firebug plug-in for Firefox I could see that the HTTP GET request had nonsense¬† e4x style xml attributes in its <amfx> content. I discovered that these xml attributes were actually the name-value pairs of the request property from the previous service call. A response, of sorts, was being returned but (unfortunately for me) not even a sniff of a FaultEvent was being generated even though the <amfx> response’s body was null! It turns out that the HTTPService send method helpfully(?) sets the parameters of the service call to the name-value pairs generated from the request property if the parameters object of the send method call is null! No really here it is…

public function send(parameters:Object = null):AsyncToken
{
 if (parameters == null)
   parameters = request;
...
}

I now reset my request object before any GET calls are issued…

this.request = {};

I hope this helps someone to avoid wasting as much time as I did on something so trivial.

*I would like to publicly apologise to the Java Web Service that I was blaming for the non-appearance of a response from the HTTPService call.

Advertisements