I am running blazeds on the server side. I would like to filter http requests using an http header. My goal is to send extra parameters to the server without changing the signatures of my blazeds services.
On the client side, I am using Flex RemoteObject methods.
With Flex WebService components, it is possible to set an http header using the property httpHeaders. I have not found anything similar on the RemoteObject class…
Best Answer
I couldnt modify http request from flex, instead I can add custom headers to the
mx.messaging.messages.IMessage
thatRemoteObject
sends to the server and there, extendingflex.messaging.services.remoting.adapters.JavaAdapter
(used for accessing Spring beans), it's posible to read the header parameters and put them into the HTTPRequest.In the flex part, I had to extend
mx.rpc.AsyncRequest
: declares a new property "header" and overwrites invoke method that checks if there is a not null value for set the msg.headers.and
mx.rpc.remoting.mxml.RemoteObject
: the constructor creates a new instance of our custom AsyncRequest and overwrite oldAsyncRequest
and it defines asetHeaders
method that set the argument to the customAsyncRequest
.com.asfusion.mate.actions.builders.RemoteObjectInvoker
(extra :P): this one reads the param declared in the Mate's mapRemoteObjectInvoker
and puts in theRemoteObject
header.I hope it will be understandable (with my apache english xDDD)
Bye. Agur!