axis-java-user mailing list archives

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

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
                        .getDataHandler();
                DataSource ds = dataHandler.getDataSource();
                ByteArrayOutputStream baos = (ByteArrayOutputStream) ds.getOutputStream();
                byte[] compressedXML = baos.toByteArray();
            }

It blows up on ds.getOutputStream(), with the exception:

java.net.UnknownServiceException
    at javax.mail.internet.MimePartDataSource.getOutputStream(MimePartDataSource.java:57)

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,

Andrew

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
View raw message