You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Nikolaus Krismer <ro...@krismer.de> on 2011/04/15 10:57:56 UTC

Howto log incoming soap "the right way" (without attachments)?

Hi,

i am using a module in axis2 to log the incoming soap messages.
However, i noticed that when sending large files (via MTOM) from a client to my webservice, everything is slowed down by far. After some debugging i found out that the problem is related to the logging of the incoming message and not the webservice logic itself. The method "getEnvelope().toString()" of the messageContext seems to log attachments also, since the time spent in this method seems to depend on the file size of the attachment sent by the webservice client.

I am using the following code to log the soap message:
<code>
private void logIn(final MessageContext messageContext) {
    if (!logger.isDebugEnabled()) {
        return;
    }

    logger.debug("Logging incoming SOAP message");
    final String msg = messageContext.getEnvelope().toString(); // seems to log attachment also
    logger.debug(msg);
}
</code>

My module is part of the "PreDisptach" phase for incoming messages and "MessageOut" for outgoing messages, but i also tried to deploy the module in its own phase.

So my question is:
Is there someway to log the incoming soap message without reading the attachments sent by the client?

Regards,
Niko




---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org