You can try traversing the whole envelope looking for <xop:include> elements
and then detach those elements from the tree.. But doing this will cause the
attachment information in the SOAP envelope to be lost and ur services may
not function properly.

One other thing you can try is to access the SOAP part data handler and log
it's contents. You can do that by getting the soap part part content id
using the Attachments.getSOAPPartContentID() and then using
Attachments.getDataHandler(SOAPPartContentID) to get access to the SOAP part
DataHandler. Then just write the contents of the DataHandler to the output
stream.

You can get access to the Attachments using msgCntx.getAttachmentMap()
method.

thanks,
Thilina

On Mon, Aug 11, 2008 at 10:51 PM, StrongSteve <[EMAIL PROTECTED]> wrote:

>
> Hi Everybody!
>
> I am currently developing an Axis2 Handler that logs all SOAP Messages
> targeted at my server into separate files.
> The problem is, that many of these SOAP Messages contain files (binary
> MTOM), which I do not want to log of course, as they just blow up the file
> size. (Instead of the binary attachment transmission I want to add a simple
> String like <ATTACHMENT REMOVED> or something like this.
>
> I already have everything working, except the attachment handling. Here is
> my code till now. (I have nothing with files or so on, I test it with plain
> System.out.printlns)
>
> public class LoggingHandler extends AbstractHandler {
>
>        public InvocationResponse invoke(MessageContext msgCtx) throws
> AxisFault {
>
>                SOAPEnvelope env = msgCtx.getEnvelope();
>
>                System.out.println(env.toString());
>
>                return InvocationResponse.CONTINUE;
>
>        }
>
> }
>
>
>
> So can anyone please help me with extracting the attachments?
> I would be very glad! ;)
>
> (Removing the Attachments with msgCtx.removeAttachment(AttachmentID), does
> not work!!!)
>
> Thanks in Advance for both your time and your knowledge!
>
> Greeting
> Stefan
> --
> View this message in context:
> http://www.nabble.com/Axis2---Handler-to-log-all-messages-without-attachments-tp18938449p18938449.html
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Thilina Gunarathne - http://thilinag.blogspot.com

Reply via email to