Chapter 12. SOAP Message Logging
The
cxf-extension-jbossws.xml
file contains the JBossWS extensions to the Apache CXF stack. You need to manually add this file and link it in the cxf.extensions
file. In cxf-extension-jbossws-xml
you need to enable:
Once you've uncommented the
cxf-extension-jbossws.xml
contents, you need to re-pack the jar or zip. Alternatively, Apache CXF offers multiple ways of configuring SOAP message logging; for programmatic configuration, the below annotations can be used on either the SEI or the SEI implementation class. If placed on the SEI, they activate logging both for client and server; if on the SEI implementation class, they are relevant just for server-side logging.
Or equivalent:
For programmatic client-side logging, the following code snippet can be used as an example:
Finally, you can also enable message logging using the Logging feature.
12.1. Debugging Tools Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Here is a list of tools that can be used to capture exchanged messages:
- Tcpmon
- TCPMon allows you to easily view messages as they go back and forth on the wire.
- WSMonitor
- WSMonitor is another option to Tcpmon with slightly more functionality.
- SOAP UI
- SOAP UI can also be used for debugging. In addition to viewing messages, it allows you send messages and load test your services. It also has plugins for Eclipse, IDEA and NetBeans.
- Wireshark
- Wireshark, a network packet analyzer, is useful for following the routing of SOAP messages. It can also help when you are getting an HTML error message from the server that your CXF client cannot normally process, by allowing you to see the non-SOAP error message.