Denismo
Denismo

Reputation: 83

How to log SOAP messages which are sent by Metro stack

I'm trying to log my messages which are sent using a Metro stack into console. Could not find any way.

Upvotes: 5

Views: 2942

Answers (3)

Denismo
Denismo

Reputation: 83

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

Upvotes: 2

rustyx
rustyx

Reputation: 85452

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

Upvotes: 6

rbrayb
rbrayb

Reputation: 46753

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.

Upvotes: 0

Related Questions