I did some testing and the following logs SOAP messages (including faults)
to System.out:
LoggingInInterceptor loggingInInterceptor = new LoggingInInterceptor();
loggingInInterceptor.setPrintWriter(new PrintWriter(System.out));
if (!cxfClient.getInInterceptors().contains(loggingInInterceptor)) {
cxfClient.getInInterceptors().add(loggingInInterceptor);
}
It's not necessary to attach the interceptor to the inbound fault chain, as
the message is logged before the contents of the message are parsed.
Colm.
On Thu, Jul 21, 2016 at 7:30 AM, Raffaele Sgarro <[email protected]>
wrote:
> So how can I tell what's going on? The log file is simply not updated when
> there are soap faults.
>
> Il mer 20 lug 2016 11:17 Colm O hEigeartaigh <[email protected]> ha
> scritto:
>
> > The WS-Security system tests all add the CXF logging feature to the Bus,
> > and it definitely logs all messages:
> >
> >
> >
> https://git-wip-us.apache.org/repos/asf?p=cxf.git;a=blob_plain;f=systests/ws-security/src/test/resources/org/apache/cxf/systest/ws/x509/client.xml;hb=HEAD
> >
> > Colm.
> >
> > On Wed, Jul 20, 2016 at 7:44 AM, Raffaele Sgarro <
> [email protected]
> > >
> > wrote:
> >
> > > Hi,
> > >
> > > I'm building the client of a SOAP service secured with WS-Security. I
> let
> > > WSS4J configure itself with the profile defined in the WSDL and
> > everything
> > > is working fine, except that the
> > LoggingInInterceptor/LoggingOutInterceptor
> > > that I build and add programmatically to the client proxy sometimes
> don't
> > > log the HTTP conversation, which would be especially useful for SOAP
> > faults
> > > (the interceptors are added to both regular/fault interceptor chains).
> > >
> > > Is it related to the SAAJ interceptor? Maybe the logging interceptors
> > don't
> > > play well with DOM builders?
> > >
> > > Here is how I configure logging: http://hastebin.com/ozelefaluw.avrasm
> > >
> > > Raffaele
> > >
> >
> >
> >
> > --
> > Colm O hEigeartaigh
> >
> > Talend Community Coder
> > http://coders.talend.com
> >
>
--
Colm O hEigeartaigh
Talend Community Coder
http://coders.talend.com