xmlspringsoaplog4jxfire

how i can log on xfire with log4j for requests and responses in XML SOAP


Hi all I have a web service with xfire and spring 3.0, I need to send to logg requests and responses xml web service, I have been looking but can not find anything.

hope you can help me as integrate with log4j.

that my code in my servlet.xml:

    <bean id="interfazXFireService"  class="org.codehaus.xfire.spring.remoting.XFireExporter">
      <property name="serviceFactory">
         <ref bean="xfire.serviceFactory" />
      </property>
      <property name="xfire">
         <ref bean="xfire" />
      </property>
      <property name="serviceBean">
         <ref bean="remoteMyServiceXfire" />
      </property>
      <property name="serviceClass">
         <value>
            com.test.xfire.service.RemoteMyServiceXfire
         </value>
      </property>
   </bean>  

Solution

  • I solved the problem agreando few handlers input, output and in case of failures, I also modified my log4j.properties file by adding the corresponding lines.

    I have been guided by the following link: http://docs.codehaus.org/display/XFIRE/Logging

    stay well and my code:

    <bean id="LoggingHandler" class="org.codehaus.xfire.util.LoggingHandler"></bean>
        <bean id="DOMInHandler" class="org.codehaus.xfire.util.dom.DOMInHandler"></bean>
        <bean id="DOMOutHandler" class="org.codehaus.xfire.util.dom.DOMOutHandler"></bean>
    
        <bean id="interfazXFireService" class="org.codehaus.xfire.spring.remoting.XFireExporter">
        <property name="inHandlers">
        <list>
            <ref bean="DOMInHandler" />
            <ref bean="LoggingHandler" />
        </list>
        </property>
        <property name="outHandlers">
        <list>
            <ref bean="DOMOutHandler" />
            <ref bean="LoggingHandler" />
        </list>
        </property>
        <property name="faultHandlers">
            <list>
            <ref bean="DOMOutHandler" />
            <ref bean="LoggingHandler" />
        </list>
        </property>
        <property name="serviceFactory">
            <ref bean="xfire.serviceFactory" />
        </property>
        <property name="xfire">
            <ref bean="xfire" />
        </property>
        <property name="serviceBean">
            <ref bean="remoteMyServiceXfire" />
        </property>
        <property name="serviceClass">
            <value>
                com.test.xfire.service.RemoteMyServiceXfire
            </value>
        </property>
    </bean> 
    

    and my stay well log4j.properties file:

    log4j.category.org.codehaus.xfire = ALL
    log4j.category.org.apache.commons.httpclient = ALL
    log4j.category.httpclient.wire = ALL
    
    # A3 is set to be a ConsoleAppender.
    log4j.appender.A3=org.apache.log4j.ConsoleAppender
    
    # A3 uses PatternLayout.
    log4j.appender.A3=org.apache.log4j.RollingFileAppender
    log4j.appender.A3.File=/var/log/RemoteXfire.log
    log4j.appender.A3.MaxFileSize=5MB
    log4j.appender.A3.layout=org.apache.log4j.PatternLayout
    log4j.appender.A3.layout.ConversionPattern=MIT: %-4r [%t] %-5p %c %x - %m%n