axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew B <>
Subject [Axis2] MTOM client error when getting attachment
Date Fri, 30 Jun 2006 15:44:29 GMT

I have a client that needs to get an MTOM attachment as a byte array. The code I came up with
is as follows:

            OMElement response = stub.getData();

            if (response.getLocalName().equals("CompressedXML"))
                OMText binaryNode = (OMText) response.getFirstOMChild();
                DataHandler dataHandler = (DataHandler) binaryNode
                DataSource ds = dataHandler.getDataSource();
                ByteArrayOutputStream baos = (ByteArrayOutputStream) ds.getOutputStream();
                byte[] compressedXML = baos.toByteArray();

It blows up on ds.getOutputStream(), with the exception:
    at javax.mail.internet.MimePartDataSource.getOutputStream(

MTOM optimization is on, and MTOM is enabled on the server. I have the latest Axis build (from
6/29). Can anyone shed some light on this error, or point me to a better way to get the attachment?

Thanks, as always,


Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
View raw message