Thank you very much for your complete answer. Actually, I am using Alfresco 3.4d, which embeds CXF 2.2.2. I have upgraded the CXF client version to 2.4.2 (the version I use on the server side), and now, this works great !
So CXF works 2.4.2 works as you say ! Thanks for your help. 2012/2/3 Daniel Kulp <[email protected]> > On Tuesday, January 31, 2012 3:33:10 PM Fabien Baligand wrote: > > Hi, > > > > When I use my CXF client, configured with MTOM enabled, to get a 5OMb > file > > ; I note that CXF downloads all the attachment content to a temp file, > and > > then, give me the InputStream to the temp file. > > > > In my case, I don't want CXF stores the content to a temp file before > > giving me access to it : I want CXF to give me directly the attachment's > > inputstream from the HTTP stream. > > I need that because I pipe the atttachment HTTP stream to another stream > in > > real time. > > > > Does someone know the CXF client configuration to set to not use a temp > > file for an attachment but directly give access to attachment HTTP > stream ? > > > > To be more clear, my code is the following : > > > > DataHandler archiveContent = myWSClient.getArchiveContent(archiveId); > > InputStream archiveStream = archiveContent.getInputStream(); > > > > My problem is in the second line, CXF doesn't return me InputStream still > > he has fully downloaded the archive content in a temp file. > > It SHOULD provide the actual HTTP stream by default unless there is > something > occurring that would require it not to. The stuff I know off the top of > my > head are: > > 1) Schema validation turned on - if you turn on schema validation, we have > to > buffer the attachment because the validation will actually consume the > stream. > > 2) JAX-WS handlers (SAAJ model requires all the attachments up front) > > 3) WS-Security (SAAJ) > > 4) Logging > > > > -- > Daniel Kulp > [email protected] - http://dankulp.com/blog > Talend Community Coder - http://coders.talend.com >
