LibraryToggle FramesPrintFeedback

You can log the content of the messages that are sent between a service and a consumer. For example, you might want to log the contents of SOAP messages that are being sent between a service and a consumer.

To see the logging of SOAP messages modify the wsdl_first sample application located in the InstallDir/samples/wsdl_first directory, as follows:

  1. Add the jaxws:features element shown in Example 7.14 to the cxf.xml configuration file located in the wsdl_first sample's directory:


  2. The sample uses the default logging.properties file, which is located in the InstallDir/etc directory. Make a copy of this file and name it mylogging.properties.

  3. In the mylogging.properties file, change the logging levels to INFO by editing the .level and the java.util.logging.ConsoleHandler.level configuration properties as follows:

  4. Start the server using the new configuration settings in both the cxf.xml file and the mylogging.properties file as follows:

    PlatformCommand
    Windowsstart java -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.server.Server
    UNIXjava -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.server.Server &
  5. Start the hello world client using the following command:

    PlatformCommand
    Windowsjava -Djava.util.logging.config.file=%CXF_HOME%\etc\mylogging.properties demo.hw.client.Client .\wsdl\hello_world.wsdl
    UNIXjava -Djava.util.logging.config.file=$CXF_HOME/etc/mylogging.properties demo.hw.client.Client ./wsdl/hello_world.wsdl

The SOAP messages are logged to the console.

Comments powered by Disqus
loading table of contents...