Hi ,

Did you try *cfx.xml* file by putting to your classpath.

I have attached my config file this enables me logging on console. No need
any programmatic access for those interceptors.

Emil


2011/4/27 Steffen Schäffner <[email protected]>

> Thank you for your answers.
>
> I tried to work with interceptors, but I always get some warnings when I
> receive/send a message.
>
> I added the following to my code:
>
>        final LoggingOutInterceptor loggingOutInterceptor = new
> LoggingOutInterceptor();
>        final LoggingInInterceptor loggingInInterceptor = new
> LoggingInInterceptor();
>
>        loggingOutInterceptor.setPrettyLogging(true);
>        loggingInInterceptor.setPrettyLogging(true);
>
>        this.factory.getInInterceptors().add(loggingOutInterceptor);
>        this.factory.getOutInterceptors().add(loggingInInterceptor);
>
> I always get the following response:
>
> 27.04.2011 08:53:18 org.apache.cxf.phase.PhaseInterceptorChain add
> WARNUNG: Skipping interceptor
> org.apache.cxf.interceptor.LoggingInInterceptor: Phase receive specified
> does not exist.
> 27.04.2011 08:53:18 org.apache.cxf.phase.PhaseInterceptorChain add
> WARNUNG: Skipping interceptor
> org.apache.cxf.interceptor.LoggingInInterceptor: Phase receive specified
> does not exist.
>
> Can anybody help?
>
> If this works, is it possible to send the logging messages in a logging
> output, for example log4j?
>
> -----Ursprüngliche Nachricht-----
> Von: Emil Dombagolla [mailto:[email protected]]
> Gesendet: Mittwoch, 27. April 2011 07:44
> An: [email protected]
> Betreff: Re: CXF and SOAP
>
> Hi ,
>
> Sometimes this may helpful to you.
>
> regarding headers
>
>
> http://cxf.apache.org/faq.html#FAQ-HowcanIaddsoapheaderstotherequest%2Fresponse%3F
>
> and for logging , best way to implement interceptor , that is what i am
> also
> doing now.
>
> http://cxf.apache.org/docs/interceptors.html
>
> or if looking to do something by your hand , this is the place to look for
> in the src.
>
> org.apache.cxf.interceptor.LoggingMessage
>
> thanks
> D
>
>
> On Tue, Apr 26, 2011 at 7:27 PM, KARR, DAVID (ATTSI) <[email protected]>
> wrote:
>
> > > -----Original Message-----
> > > From: Steffen Schäffner [mailto:[email protected]]
> > > Sent: Tuesday, April 26, 2011 4:50 AM
> > > To: [email protected]
> > > Subject: CXF and SOAP
> > >
> > > Hello there,
> > >
> > > I have some more questions about CXF.
> > >
> > > I am using CXF 2.4.0.
> > >
> > >
> > > 1.       If I don't use an authorization, no header will be added to
> > > the SOAP message. How can I change that? If no header is within, I will
> > > get an error from my server.
> >
> > I assume you've confirmed this, not just guessing that you'll get an
> error?
> >  The Soap schema specifies that the header is optional, so a server that
> > gives a specific error saying the header is missing, is defective.
> >
> > Years ago, I noticed that the Websphere web services infrastructure would
> > throw an NPE if a Soap header was not present.  Are you using Websphere
> on
> > the server, by any chance?
> >
>
<beans xmlns="http://www.springframework.org/schema/beans";
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:http-conf="http://cxf.apache.org/transports/http/configuration";
      xmlns:cxf="http://cxf.apache.org/core";
      xsi:schemaLocation="http://cxf.apache.org/transports/http/configuration
		  http://cxf.apache.org/schemas/configuration/http-conf.xsd
		http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
		http://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"/>
    <bean id="logOutbound" class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
 
    <cxf:bus>
        <cxf:inInterceptors>
            <ref bean="logInbound"/>
        </cxf:inInterceptors>
        <cxf:outInterceptors>
            <ref bean="logOutbound"/>
        </cxf:outInterceptors>
        <cxf:outFaultInterceptors>
            <ref bean="logOutbound"/>
        </cxf:outFaultInterceptors>
        <cxf:inFaultInterceptors>
            <ref bean="logInbound"/>
        </cxf:inFaultInterceptors>
    </cxf:bus> 
    
</beans>

Reply via email to