I'm trying to log my messages which are sent using a Metro stack into console. Could not find any way.
Asked
Active
Viewed 2,890 times
3 Answers
5
Message logging to stdout (valid for METRO only!):
On the client
Java 5: Set system property
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
Java 6: Set system property
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
On the server side
Set system property
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true

rustyx
- 80,671
- 25
- 200
- 267
-
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true is a saver for those needing to dump messages on the client side. – Ceki May 06 '11 at 09:27
-
People say that package is slightly different from java 1.6, namely: `-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true` (note additional `internal` after `xml`). And I confirm that it's true. – dmitry Feb 11 '13 at 12:49
1
Here everything is explained:
https://metro.java.net/2.0/guide/Logging.html
The following options enable logging of all communication to the console (technically, you only need one of these, but that depends on the libraries you use, so setting all four is safer option).
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dump=true
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
0
Didn't mention the language but assuming Java, could you not just use something like Log4J e.g.
service = new Service();
port = service.getXxxPort();
result = port.doXxx(data);
Log.info("Result is " + result.getResult().toString());
where getResult is just a method on the return object.

rbrayb
- 46,440
- 34
- 114
- 174