[flexcoders] Re: How do I add a header or additional post parameter to a RemoteObject Request
Valdhor, thanks for the reply. I actually call the function directly on the service with the args: myService.getMyStuff(data1, data2); I want to put uniqueToken on the POST request itself, so that I don't have to change all the method signatures to include the token. When the request goes through a web filter in my app, I want to be able to do something like httpServletRequest.getParameter(uniqueToken) or putting it on the header would work: httpServletRequest.getHeader(uniqueToken) Is there any way to do this? Thanks again. --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: Just send an object as the parameter that you send: var myService:RemoteObject = new RemoteObject(); myService.source = myServices.MyService; myService.destination = amfphp; myService.requestTimeout = 30; myService.addEventListener(ResultEvent.RESULT, myResult); myService.addEventListener(FaultEvent.FAULT, faultHandler); var myParameters:Object = new Object(); myParameters.data1 = data1; myParameters.data2 = data2; myParameters.uniqueToken = myUniqueToken ; myService.getOperation('getMyStuff').send(myParameters); --- In flexcoders@yahoogroups.com, jennie_mai_nguyen jennie_mai_nguyen@ wrote: Hi there, Is it possible to add a header or an additional post parameter to a remoting request (using RemoteObject)? I need to include a unique token to every remoting request, but have not found a way to do it. I also tried to use the RemoteObject.setRemoteCredentials(), reading that it will set the DSCredentials header, but I don't see it on the servletRequest when one of the web filters on the server processes it. Any feedback is appreciated. Thanks.
[flexcoders] Re: How do I add a header or additional post parameter to a RemoteObject Request
The only way I see to do what you want is to delve into sockets but this would be a very difficult proposition. I still think you are better off putting all your data into a generic object (Or better yet, a VO) and pulling it out on the server. This will give you a lot more flexibility in the future (If you need to add another parameter, it is very simple to do so) for a bit of extra effort to rewrite your accessor methods. Maybe someone else here has an idea? --- In flexcoders@yahoogroups.com, jennie_mai_nguyen [EMAIL PROTECTED] wrote: Valdhor, thanks for the reply. I actually call the function directly on the service with the args: myService.getMyStuff(data1, data2); I want to put uniqueToken on the POST request itself, so that I don't have to change all the method signatures to include the token. When the request goes through a web filter in my app, I want to be able to do something like httpServletRequest.getParameter(uniqueToken) or putting it on the header would work: httpServletRequest.getHeader(uniqueToken) Is there any way to do this? Thanks again. --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote: Just send an object as the parameter that you send: var myService:RemoteObject = new RemoteObject(); myService.source = myServices.MyService; myService.destination = amfphp; myService.requestTimeout = 30; myService.addEventListener(ResultEvent.RESULT, myResult); myService.addEventListener(FaultEvent.FAULT, faultHandler); var myParameters:Object = new Object(); myParameters.data1 = data1; myParameters.data2 = data2; myParameters.uniqueToken = myUniqueToken ; myService.getOperation('getMyStuff').send(myParameters); --- In flexcoders@yahoogroups.com, jennie_mai_nguyen jennie_mai_nguyen@ wrote: Hi there, Is it possible to add a header or an additional post parameter to a remoting request (using RemoteObject)? I need to include a unique token to every remoting request, but have not found a way to do it. I also tried to use the RemoteObject.setRemoteCredentials(), reading that it will set the DSCredentials header, but I don't see it on the servletRequest when one of the web filters on the server processes it. Any feedback is appreciated. Thanks.
[flexcoders] Re: How do I add a header or additional post parameter to a RemoteObject Request
Hi Valdhor, I ended up doing what you first suggested by passing the token in as a method argument. I process the token in flex.messaging.endpoints.amf.MessageBrokerFilter. I then take out the token from the parameter list after processing, so that the remote APIs don't have to change their signatures. Not sure if anyone would have a requirement like this, but I'm putting it up here in case it helps. Thanks again. --- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote: The only way I see to do what you want is to delve into sockets but this would be a very difficult proposition. I still think you are better off putting all your data into a generic object (Or better yet, a VO) and pulling it out on the server. This will give you a lot more flexibility in the future (If you need to add another parameter, it is very simple to do so) for a bit of extra effort to rewrite your accessor methods. Maybe someone else here has an idea? --- In flexcoders@yahoogroups.com, jennie_mai_nguyen jennie_mai_nguyen@ wrote: Valdhor, thanks for the reply. I actually call the function directly on the service with the args: myService.getMyStuff(data1, data2); I want to put uniqueToken on the POST request itself, so that I don't have to change all the method signatures to include the token. When the request goes through a web filter in my app, I want to be able to do something like httpServletRequest.getParameter(uniqueToken) or putting it on the header would work: httpServletRequest.getHeader(uniqueToken) Is there any way to do this? Thanks again. --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote: Just send an object as the parameter that you send: var myService:RemoteObject = new RemoteObject(); myService.source = myServices.MyService; myService.destination = amfphp; myService.requestTimeout = 30; myService.addEventListener(ResultEvent.RESULT, myResult); myService.addEventListener(FaultEvent.FAULT, faultHandler); var myParameters:Object = new Object(); myParameters.data1 = data1; myParameters.data2 = data2; myParameters.uniqueToken = myUniqueToken ; myService.getOperation('getMyStuff').send(myParameters); --- In flexcoders@yahoogroups.com, jennie_mai_nguyen jennie_mai_nguyen@ wrote: Hi there, Is it possible to add a header or an additional post parameter to a remoting request (using RemoteObject)? I need to include a unique token to every remoting request, but have not found a way to do it. I also tried to use the RemoteObject.setRemoteCredentials(), reading that it will set the DSCredentials header, but I don't see it on the servletRequest when one of the web filters on the server processes it. Any feedback is appreciated. Thanks.
[flexcoders] Re: How do I add a header or additional post parameter to a RemoteObject Request
Just send an object as the parameter that you send: var myService:RemoteObject = new RemoteObject(); myService.source = myServices.MyService; myService.destination = amfphp; myService.requestTimeout = 30; myService.addEventListener(ResultEvent.RESULT, myResult); myService.addEventListener(FaultEvent.FAULT, faultHandler); var myParameters:Object = new Object(); myParameters.data1 = data1; myParameters.data2 = data2; myParameters.uniqueToken = myUniqueToken ; myService.getOperation('getMyStuff').send(myParameters); --- In flexcoders@yahoogroups.com, jennie_mai_nguyen [EMAIL PROTECTED] wrote: Hi there, Is it possible to add a header or an additional post parameter to a remoting request (using RemoteObject)? I need to include a unique token to every remoting request, but have not found a way to do it. I also tried to use the RemoteObject.setRemoteCredentials(), reading that it will set the DSCredentials header, but I don't see it on the servletRequest when one of the web filters on the server processes it. Any feedback is appreciated. Thanks.