Usually we will have an InputStream object. But I didn't make it work. I tried using a byte array as input.
you can easily convert an InputStream to a byte array. After that, use ByteArrayDataSource.

                // Build OMText to hold binary data
                byte[] binaryBytes = ...;
                ByteArrayDataSource dataSource = new ByteArrayDataSource(binaryBytes );
                DataHandler expectedDH = new DataHandler(dataSource);
                OMText textData = omFactory.createOMText(expectedDH, true);


On 9/28/06, sam wang <[EMAIL PROTECTED]> wrote:
Hi, there,

I have a question about transferring binary attachment through Axis2. I want to transfer binary
attachment from server side to client side. My question is that if I can attach any kind of binary
data? from Axis2's api, I see there are only two datasource: file and image. theoritically, Axis2
can transfer any kind of object because we can first serialize any object to disk, save it as a
file, and then construct file datasource to attach into soap as binary attachment. but it will not
be efficient. so my question is that if there is a way to attach the object (for example,
CachedRowSet) to soap directly and return to client, instead of saving as file first. if it can,
could anyone give me a java snippet?

thank you very much!
Sam

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to