Thank you for response. I have written a testclient to try spring blazeds integration with headers.
Code:
import flex.messaging.io.amf.client.AMFConnection;
import junit.framework.TestCase;
public class TestBaseService extends TestCase {
public void testHelo() throws Exception {
AMFConnection connection = new AMFConnection();
connection.connect("myurl");
connection.addAmfHeader("key", "value");
Object result = connection.call("myservice.hello");
}
}
But in the interceptor
Code:
import org.springframework.flex.core.MessageInterceptor;
import org.springframework.flex.core.MessageProcessingContext;
import flex.messaging.messages.Message;
public class FlexInterceptor implements MessageInterceptor {
@Override
public Message postProcess(MessageProcessingContext context, Message inputMessage,
Message outputMessage) {
outputMessage.setHeader("key_out", "value_out");
return outputMessage;
}
@Override
public Message preProcess(MessageProcessingContext context, Message inputMessage) {
// control incoming msgs
String header = (String) inputMessage.getHeader("key");
return inputMessage;
}
}
i do net geht the header "key" (and the set header "key_out" does not get out). When i debug just before the interceptor (flex.messaging.endpoints.amf.MessageBrokerFilter. invoke(final ActionContext context)) i can see the header in the context.requestMessage.requestHeaders.
Conclusion: I expected the header to retrieve by inputMessage.getHeader("key"); - it is there, but i do not get it.