Sounds good.

I even have a more radical idea. I just recently tweaked the CXF LoggingFeature. So it now writes to different logger categories for each service. So we might also think about doing logging all the time and only enable / disable it through the logger config.

The reason why I think this is a good idea is that basically you should always be able to active logging at runtime. So you will probably need to activate the logging feature anyway.

Christian


Am 08.11.2011 11:36, schrieb Claus Ibsen:
Hi

When working with camel-cxf, you can get pretty fast setup with the
Camel cxfEndpoint element as shown:

For example to call the famous weather web service

   <cxf:cxfEndpoint id="weatherWebService"
                    address="http://www.webservicex.net/globalweather.asmx";
                    endpointName="s:GlobalWeatherSoap"
                    serviceName="s:GlobalWeather"
                    wsdlURL="http://www.webservicex.net/globalweather.asmx?WSDL";
                    xmlns:s="http://www.webserviceX.NET";>


However to enabling logging of INBOUND and OUTBOUND messages with CXF,
you need to thinker with interceptors.
And IMHO that is a bit PITA as its kinda hard to remember all the
mighty XML stuff you need to add, just to see what is send out and
comes back in the console / logs.

Currently you would have to added these 4 interceptors, and remember
also what the class names of the interceptor bean is

   <cxf:cxfEndpoint id="weatherWebService"
                    address="http://www.webservicex.net/globalweather.asmx";
                    endpointName="s:GlobalWeatherSoap"
                    serviceName="s:GlobalWeather"
                    wsdlURL="http://www.webservicex.net/globalweather.asmx?WSDL";
                    xmlns:s="http://www.webserviceX.NET";>

         <cxf:inInterceptors>
             <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
         </cxf:inInterceptors>
         <cxf:inFaultInterceptors>
             <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
         </cxf:inFaultInterceptors>
         <cxf:outInterceptors>
             <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
         </cxf:outInterceptors>
         <cxf:outFaultInterceptors>
             <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
         </cxf:outFaultInterceptors>

   </cxf:cxfEndpoint>


Thats is a lot of XML just to play with a web service.

It would be much easier if there was a attribute that could setup
these logging interceptors for you out of the box. So all you have to
do was set logging attribute to true.

   <cxf:cxfEndpoint id="weatherWebService"
                    logging="true"
                    address="http://www.webservicex.net/globalweather.asmx";
                    endpointName="s:GlobalWeatherSoap"
                    serviceName="s:GlobalWeather"
                    wsdlURL="http://www.webservicex.net/globalweather.asmx?WSDL";
                    xmlns:s="http://www.webserviceX.NET";>


Any thoughts?





--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com

Reply via email to