On Sep 10, 2013, at 4:32 PM, Frizz <[email protected]> wrote:
> OK, changed it to msg.getExchange().get(Message.REST_MESSAGE). Not it shows
> the expected value ("true").
>
> But what I don't understand is that my IN interceptor is called 2x per call
> (also my OUT interceptor is called 2x).
>
> e.g. I do 1x http://localhost:8080/myservice in my browser, but the
> interceptors are triggered 2x.
Can you wireshark the interaction. It's possible that the browser is first
sending a HEAD request or similar to see if it can use it's cached copy.
Dan
>
> My web service is running in an OSGi container (Felix/Karaf). Bus Listener
> is added with a blueprint xml:
>
> ...
> <bean id="myBusCreationListener"
> class="demo.listener.MyBusCreationListener">
> </bean>
>
> <service ref="myBusCreationListener"
> interface="org.apache.cxf.buslifecycle.BusCreationListener" />
> ...
>
>
>
>
> On Tue, Sep 10, 2013 at 10:17 PM, Sergey Beryozkin
> <[email protected]>wrote:
>
>> Hi
>>
>> On 10/09/13 21:09, Frizz wrote:
>>
>>> Hi,
>>>
>>> I've just added an IN and an OUT interceptor to the CXF bus. That works.
>>>
>>> My IN interceptor is for Phase.PRE_INVOKE.
>>>
>>> In my IN interceptors handleMessage(Message msg) method I try to figure
>>> out
>>> whether it's a REST or a SOAP message. But the REST_MESSAGE property is
>>> always null.
>>>
>>> System.out.println(">>>>> REST_MESSAGE: " +
>>> msg.get(Message.REST_MESSAGE))**;
>>> System.out.println(">>>>> TRANSPORT: " + msg.get(Message.TRANSPORT));
>>> ...
>>>
>>> Same for TRANSPORT.
>>>
>>> All the other properties have correct values.
>>>
>>> Bug - or am I doing something wrong?
>>>
>>> This property is set on the exchange for it to be visible in/out, so
>> msg.getExchange().get(Message.**REST_MESSAGE) will do it...
>>
>> Cheers, Sergey
>>
>> cheers,
>>> F.
>>>
>>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>> Blog: http://sberyozkin.blogspot.com
>>
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com