Home  >  Article  >  Java  >  How Can I Trace XML Requests and Responses in JAX-WS Without Using Proxies?

How Can I Trace XML Requests and Responses in JAX-WS Without Using Proxies?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-10-29 04:29:02543browse

How Can I Trace XML Requests and Responses in JAX-WS Without Using Proxies?

Tracing XML Request/Responses in JAX-WS without Proxies

Utilizing JAX-WS reference implementation, it is possible to access raw request/response XML for webservices without employing proxies. This can be achieved by setting system properties that enable logging communication. Here's the code to accomplish this:

<code class="java">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");</code>

Alternatively, these properties can be set via command line parameters using "-D" or through environment variables. By enabling these options, all communication will be logged to the console, providing insights into the XML request and response.

For additional details, refer to the StackOverflow discussion "Tracing XML request/responses with JAX-WS when error occurs." This method allows for simple and efficient tracing capabilities within JAX-WS without introducing additional framework overhead.

The above is the detailed content of How Can I Trace XML Requests and Responses in JAX-WS Without Using Proxies?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn