You need to get the protocol headers map out of the message and put your stuff
there. The "get/put" stuff on the message is for storage of stuff related to
processing the message. That includes stuff that would not be protocol
headers.
Map<String, List<String>> reqHeaders =
CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
if (reqHeaders == null) {
reqHeaders = new HashMap<String, List<String>>();
message.put(Message.PROTOCOL_HEADERS, reqHeaders);
}
....
Dan
On Wed July 8 2009 1:39:10 pm Alexandre N wrote:
> Hi,
>
> I want to add a field in http header (not in soap header).
>
> I did a out interceptor.
>
> public class MyOutInterceptor extends AbstractSoapInterceptor
> {
>
> public MyOutInterceptor()
> {
> super(Phase.POST_LOGICAL);
> }
>
>
> @Override
> public void handleMessage(final SoapMessage message) throws Fault
> {
> System.out.println("MyOutInterceptor.handle soapMessage=" +
> message);
> message.put("token", "tokenValue");
> message.put("SOAPAction", "action2");
> }
> }
>
> It is quite weird because SOAPAction is correct to action2 but token is not
> added.
> I suppose is because it was present before but I don't know why.
> I tried others phases but without success.
>
> If someone has a solution.
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog