cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ernst Oberortner <e.oberort...@infosys.tuwien.ac.at>
Subject Re: interceptors - message
Date Wed, 28 Apr 2010 07:08:58 GMT
hi gabo...

many thanks for your help...
this was the solution to my problem...

cheers,
ernst


> Hi Ernst,
>
> I do not think that is how Exchange works. My suggestion is for your  
> client's out interceptor to place those values as header parameters.  
> Then your server in interceptor to catch those headers and place it  
> in the message's exchange.
>
> Hth.
>
> Gabo
>
> Ernst Oberortner wrote:
>> i'm sorry... i tried it... but it's still not working...
>>
>> here are some excerpts of my source-code...
>>
>> on the client side, i put the following interceptor into every  
>> phase of the CLIENT's OUT chain...
>> public class ClientOutInterceptor extends  
>> AbstractPhaseInterceptor<Message> {
>> ...
>>    public void handleMessage(Message msg) throws Fault {
>>        msg.getExchange().put("ABC",new String("ABC"));
>>        msg.getExchange().getOutMessage().put("ABC",new  
>> String("ABC"));
>>    }
>> ...
>> }
>>
>> at the service host, i put the following interceptor into every  
>> phase of the SERVER's IN chain...
>> public class ServerInInterceptor extends  
>> AbstractPhaseInterceptor<Message> {
>> ...
>>    public void handleMessage(Message msg) throws Fault {
>>        if(msg.getExchange().getInMessage().get("ABC")==null) {
>>            System.out.println("ABC not present in IN message");
>>        }
>>        if(msg.getExchange().get("ABC")==null) {
>>            System.out.println("ABC not present in exchange message");
>>        }
>>    }
>> ...
>> }
>>
>> but, the server's interceptors always say...
>> ABC not present in IN message
>> ABC not present in exchange message
>>
>> what am i doing wrong? any hints please?
>> thx!
>>
>> cheers,
>> ernst
>>
>>>
>>> The message object holds onto the exchange which holds onto both  
>>> the in and
>>> out messages.   Thus, on the in chain, you can do
>>> msg.getExchange().getInMessage().get(...);
>>>
>>> Alternatively, the Exchange also implements Map.   Thus, store it  
>>> on the
>>> Exchange itself.
>>>
>>> Dan
>>>
>>>
>>> On Thu November 19 2009 9:11:10 am Ernst Oberortner wrote:
>>>> dear all!
>>>>
>>>> i have a question regarding the data of the message which is  
>>>> transfered
>>>> from the client to the service...
>>>>
>>>> example:
>>>> i have an interceptor in the client out-chain (doesn't matter yet  
>>>> in
>>>> which phase) which puts some data into the message
>>>> (by using the Message.put method)... now i want to read the data  
>>>> in the
>>>> in-chain of the service host...
>>>>
>>>> i haven't discovered yet any possibility how to implement this...
>>>>
>>>> so please... can anybody help me by giving hints, examples, or  
>>>> links?
>>>>
>>>> many thanks in advance!
>>>>
>>>> best regards,
>>>> ernst
>>>>
>>>
>>> -- 
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://www.dankulp.com/blog
>>
>>


Mime
View raw message