views:

148

answers:

1

I am trying to work with a simple HTTPService. The problem is that my webservice is conscious of the order of arguments it gets. I will tell the problem with an example:

var service:HTTPService = new HTTPService(); 
var params:Object = new Object(); 
params.rows = 0;
params.facet = "true"; 
service.send(params); 

Note that in the above code I have mentioned the parameter rows before facet, but the url I recieve is facet=true&rows=0. So I recieve the argument rows before facet and hence my webservice does not work. I figured out that the contents of array is always sent in alphabetical order, which I dont want.

Is there any way I can achieve explict ordering of parameters sent?

Note that I am not in power of changing the logic of webservice(its basically a RPC service supporting both desktop and web client).

Thanks.

+1  A: 

I am assuming you are using a get method. Instead of passing params to the HTTPService, build a url string. You can pass get params just by changing that string then calling the service.

service.url = "originalURL" + "?" + "rows=0" + "&" + "facet=true";
service.send();
invertedSpear
i knew this already...but was wondering there was a more flexible way of doing it instead of hardcoding the url. As of now, I thin kI have to stick with this.
Suraj Chandran