Home > Java > javaTutorial > How to Trace XML Request/Responses with JAX-WS without Proxies?

How to Trace XML Request/Responses with JAX-WS without Proxies?

Susan Sarandon
Release: 2024-10-29 10:52:02
Original
1000 people have browsed it

How to Trace XML Request/Responses with JAX-WS without Proxies?

Tracing XML Request/Responses with JAX-WS without Proxies

For Java developers utilizing the JAX-WS reference implementation for web service publishing, the ability to directly access the raw XML request and response is crucial for debugging. This article presents a simple and code-based solution to achieve this without relying on external frameworks or proxies.

Solution

The following code properties enable logging of all communication to the console:

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");
Copy after login

By setting these properties, the raw XML request and response will be logged to the console for easy inspection. This solution allows developers to trace and debug communication without the overhead of additional frameworks.

The above is the detailed content of How to Trace XML Request/Responses with JAX-WS without Proxies?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template