Thanks Thilina. 
 
That fixed the problem. 
 
I actually wanted to use DataHandler initially, but I didn't know about
ByteArrayDataSource until your email since we are dealing with non-file
data.
 
Thanks, 
 
Nadeem

________________________________

From: Thilina Gunarathne [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 24, 2007 3:56 AM
To: [email protected]
Subject: Re: byte[] problem with a class


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] < [EMAIL PROTECTED]>
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 "[EMAIL PROTECTED]",
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: [EMAIL PROTECTED]
        For additional commands, e-mail: [EMAIL PROTECTED]
        
        




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

Reply via email to