axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thilina Gunarathne" <cset...@gmail.com>
Subject Re: byte[] problem with a class
Date Sun, 23 Dec 2007 23:55:44 GMT
Hi,
Try using javax.activation.DataHandler instead of the byte[].. Then use a
FileDataSource or  a bytearraydatasource to create the needed DataHandler
object.

thanks,
Thilina

On Dec 23, 2007 2:45 PM, Hoda, Nadeem [USA] <hoda_nadeem@bah.com> wrote:

>
>
> I noticed that others had a problem with a byte[] within a class. And, I
> am running into this issue now.
>
> Here is an example of the scenario:
>
>
> class Attachment{
>        byte[] attachmentImage; //with getter/setter
> }
>
> Using POJO services:
>
> This works:
>
> public Attachment getAttachment(String id) {...}
>
> But, this does not work:
>
> public String uploadAttachment(Attachment attachment) {...}
>
> In uploadAttachment(), the received attachment contains what seems to be
> a reference of some sort instead of a byte[].
>
> For example, I got the following result:
>
> The received Attachment.attachmentImage was set to "[B@16daa9", for
> example, with a length of 0 when I passed a file represented by a byte[]
> from multiple clients.
>
> I am not using MTOM due to client limitations, so I need to use direct
> data in the SOAP message.
>
> Is there any resolution to this, or something I am missing?
>
> Thanks,
>
> Nadeem
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


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

Mime
View raw message