Dan Diephouse wrote:
> Kohsuke Kawaguchi wrote:
>> Dan Diephouse wrote:
>>> I have a schema which contains an image like so:
>>>
>>> <s:element name="image" type="s:base64Binary"
>>> xmime:expectedContentTypes="image/jpeg"/>
>>>
>>> I've been loading in the image and setting the Image field on my
>>> Jaxb object:
>>>
>>> File file = getTestFile("src/test-resources/xfire.jpg");
>>> Image image =
>>> ImageIO.read(getTestFile("src/test-resources/xfire.jpg"));
>>> response.setImage(image);
>>>
>>> The image is about 25K. However, in my AttachmentMarshaller I only
>>> receive a 3K byte[] array from this method:
>>>
>>> public String addMtomAttachment(byte[] data,
>>> int offset,
>>> int length,
>>> String mimeType,
>>> String elementNamespace,
>>> String elementLocalName)
>>>
>>> Any ideas why I am not receiving the real raw data from the image?
>>
>> Hmm. I checked the relevant code.
>>
>> Do you have the JAXB source zip? I wonder if you could take a look at
>> the call stack in the debugger to see if you can spot anything wrong.
>>
>> JAX-WS guys are testing those too, so I'll ask how large an image
>> they are trying.
>>
> Alright, I'll take a peek and get back to you.
> - Dan
>
I can't see anything blatently wrong, but
a) it does only write out 4K of data in the PcdataImpl<Image>
b) The code scares me as it seems to totally caches images in memory,
making large images impossible.
- Dan
--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog