I don't think its as easy for that one. However what you can do is
just remove the LoggingOutInterceptor from the current interceptor
chain. We have a method to do that in our code that you can use:
public static void removeInterceptor(Class<? extends Interceptor<?>>
interceptorType, Message message) {
Iterator<Interceptor<? extends Message>> iterator =
message.getInterceptorChain().iterator();
Interceptor<?> removeInterceptor = null;
for (; iterator.hasNext();) {
Interceptor<?> interceptor = iterator.next();
if (interceptorType.isInstance(interceptor)) {
removeInterceptor = interceptor;
break;
}
}
if (removeInterceptor != null) {
LOGGER.debug("Removing interceptor {}",
removeInterceptor.getClass().getName());
message.getInterceptorChain().remove(removeInterceptor);
}
}
There might be a code in CXF but I have not found it.
So basically what you could do is this:
removeInterceptor(LoggingOutInterceptor.class, message);
On Thu, Oct 25, 2012 at 8:50 PM, Bruno Cappoen <[email protected]> wrote:
> Hi, thanks. The endpoint of this service is not in my application. I made a
> mistake, it's LoggingOutInterceptor. We use a remote service and we can't
> modify this service, so we can't add a key.
>
> <jaxws:client id="helloClient"
> serviceClass="demo.spring.HelloWorld"
> address="http://localhost:9002/HelloWorld">
> <jaxws:inInterceptors>
> <ref bean="removeLoggingInInterceptorInterceptor"/>
> </jaxws:inInterceptor>
>
> *
> *
>
> I don't see what i must put in the
> RemoveLoggingInInterceptorInterceptor to override logginOutInterceptor
> in the cxf bus.
>
> *
> *
>
> THanks
>
>
> 2012/10/25 Jason Pell <[email protected]>
>
>> In fact what you could do is have this
>> RemoveLoggingInInterceptorInterceptor you write defined in
>> the specific Security Web Service jaxws:endpoint, so it does not even
>> have to check the current
>> endpoint info. If its defined for an endpoint it automatically
>> removes the interceptor.
>>
>> An alternative to removing the interceptor would be to trick the
>> interceptor into not
>> executing any logging. If you check the start of the interceptor it
>> has the code:
>>
>> if (message.containsKey(LoggingMessage.ID_KEY)) {
>> return;
>> }
>>
>> You could in your custom interceptor add this key to the message so
>> that the above
>> if evaluates to true. Just make sure the interceptor is registered to
>> runBefore LoggingInInterceptor
>>
>>
>> On Thu, Oct 25, 2012 at 10:47 AM, Jason Pell <[email protected]> wrote:
>> > I am sure there is a better way - but what you could do is add an
>> > additional interceptor that executes as part of the SETUP phase. This
>> > would check what endpoint it is on and optionally remove the
>> > LoggingInInterceptor from the current execution chain.
>> >
>> > I am sure others will have better solutions
>> >
>> > On Thu, Oct 25, 2012 at 8:35 AM, Bruno Cappoen <[email protected]>
>> wrote:
>> >> Hi everybody, i'm using a LoggingInInterceptor on the cxf bus to log
>> >> all the requests of my webservices.
>> >> It works perfectly.
>> >> In my webservices, i have a secure webservice for authentication. The
>> >> password is in the request (payload) and it is displayed
>> >> in the log.
>> >>
>> >> Is it possible to disable the LoggingInInterceptor for a specific
>> >> webservice ? Have you got a solution ?
>> >>
>> >> I don't want to specify for each webservice the interceptor because i
>> >> have many webservices and here, it's a specific need.
>> >>
>> >>
>> >> Thank you for your help.
>> >>
>> >>
>> >>
>> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> xmlns:cxf="http://cxf.apache.org/core"
>> >> xsi:schemaLocation="http://cxf.apache.org/core
>> >>
>> http://cxf.apache.org/schemas/core.xsdhttp://www.springframework.org/schema/beans
>> >> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
>> >>
>> >> <bean id="logInbound"
>> >> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>> >>
>> >>
>> >> <cxf:bus>
>> >> <cxf:outInterceptors>
>> >> <ref bean="logInbound"/>
>> >> </cxf:outInterceptors>
>> >> </cxf:bus> </beans>
>>