cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre N <alexandre.nava...@sgcib.com>
Subject Re: Add a field in http headers does not work?
Date Wed, 08 Jul 2009 19:10:02 GMT

I tried before but it did not work.
I realised I was in the wrong phase (I must be in write phase) and now it
works.

So thanks a lot and I think it can be useful for users to detail what you
can (or cannot do) in the different phases in the documentation.

Alexandre


dkulp wrote:
> 
> 
> 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
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Add-a-field-in-http-headers-does-not-work--tp24396137p24397540.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message