Tracing XML Request/Response with JAX-WS
This question seeks a method to access raw XML request/response data for JAX-WS webservices without using proxies. The user emphasizes the need for simplicity and wishes to avoid the overhead of frameworks like Axis or CXF.
Solution:
To enable logging of XML communication to the console, configure the following system properties:
System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true"); System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true"); System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true"); System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true"); System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");
This enables exhaustive logging of all communication, including XML requests and responses. By setting the dumpTreshold property to 999999, it ensures logging of all content regardless of size.
Alternatively, this logging can be enabled as command line parameters using -D or as environment variables, as suggested by Upendra.
By utilizing this logging mechanism, you can access and trace the raw XML request/response data for webservices published with JAX-WS without the need for complex frameworks or proxies.
The above is the detailed content of How to Trace JAX-WS XML Request/Response Data Without Proxies?. For more information, please follow other related articles on the PHP Chinese website!