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 Darren Marvin <dj...@it-innovation.soton.ac.uk> on 2003/12/23 17:31:22 UTC

Accessing attachments within a response handler

Hi all,

It might not be the best way but if you want to access an attachment from within a response handler then do the following
 
call getAsBytes() on the SOAPPart for the response message 

e.g.

org.apache.axis.Message outMsg = msgContext.getResponseMessage();
((org.apache.axis.SOAPPart) outMsg.getSOAPPart()).getAsBytes();

This seems to force the message to serialise and thereby create the attachment objects. You can then access the attachments normally.

Hopefully I am not exploiting something I shouldn't.