Skip to main content

Summary How to log SOAP message content in Artix 5.x trace log?
Article Number 29940
Environment Artix 5.x
All Supported Operating Systems
Question/Problem Description An Artix 5.x process (client or server) is not set by default to print the content of exchanged SOAP messages in its log. How can this feature be achieved?
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution In order to get a SOAP message trace for an Artix 5.x process, the steps to take are  the following:

1- The Spring configuration of the Artix client process should look like the following:

  <jaxws:client name="{http://cxf.apache.org/mime}TestPort"
                    implementor="demo.server.TestPortTypeImpl"
                    serviceName="hw:TestService"
                    endpointName="hw:TestPort">
        <jaxws:features>
            <bean class="org.apache.cxf.feature.LoggingFeature" />
        </jaxws:features>
    </jaxws:endpoint>


Note that the name attribute should be set as {namespace}portname format, and that the <jaxws:features> element should include the bean "org.apache.cxf.feature.LoggingFeature".

For the case of an Artix server process, it should look like:

      <jaxws:endpoint name="{http://cxf.apache.org/mime}TestPort"
                    implementor="demo.mtom.server.TestPortTypeImpl"
                    serviceName="hw:TestService"
                    endpointName="hw:TestPort"
                    createdFromAPI="true">
        <jaxws:features>
            <bean class="org.apache.cxf.feature.LoggingFeature" />
        </jaxws:features>
    </jaxws:endpoint>


The only main difference between the server and client configuration is that the server one should have the attribute createdFromAPI set to "true", in case it is a standalone server. It is not needed in case the server is hosted in a container, such as a spring container.

2- Set up the process (client or server) with a log4j property file that contains the following logging levels:

org.apache.cxf.configuration.spring, org.apache.cxf.interceptor.LoggingInInterceptor and org.apache.cxf.interceptor.LoggingOutInterceptor levels should be set to "FINEST" 

3- Set the property "java.util.logging.FileHandler.limit" in the log4j properties file to be a big value (1000000 for example), since there will be a lot of information logged.
Workaround
Notes
Attachment

Created date: 20 March 2012
Last Modified: 13 February 2013
Last Published: 12 May 2012
First Published date: 20 March 2012

#Orbix
#KnowledgeDocs