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 Thilina Gunarathne <cs...@gmail.com> on 2006/07/03 14:14:29 UTC

Re: [Axis2] MTOM client error when getting attachment

Hi,
Code seems to be corect at first glance....

Can you post the full error trace and the message snapshots...

~Thilina


On 6/30/06, Andrew B <vi...@yahoo.com> wrote:
>
> 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
>



-- 
"May the SourcE be with u"
http://webservices.apache.org/~thilina/
http://thilinag.blogspot.com/
http://www.bloglines.com/blog/Thilina