cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: How to replace the output stream
Date Wed, 04 Mar 2009 15:33:30 GMT


There isn't a way to do this that doesn't break streaming.   For the normal 
"soap" case, in order to properly stream, we have to kind of "assume" that 
writing isn't going to cause any failures.   However, if schema validation is  
turned on, we do recognize that it could fail.  (this PROBABLY should be also 
controllable by a user property)  In that case, we kind of go into a "event 
buffering" mode where the XML events are buffered and replayed if the marshall 
succeeded.   See the AbstractOutDatatbinding code.  

You PROBABLY want something similar.   Normal mode would probably be to 
stream, but provide some sort of config flag or something to allow it to go 
into non-streaming/buffering mode. 

If you DO add a config option, we should update the AbstractOutDatatbinding to 
accept the same config option.


On Wed March 4 2009 9:01:45 am Sergey Beryozkin wrote:
> Hi,
> I'm looking at at the
> moment. The problem is that after some initial writes to an out message's
> OutputStream an exception is thrown and it's handled seperately by also
> writing something to the output stream.
> Now, when it occurs the original OutputStream should really be replaced
> with a new one. But can this be done at the moment ? It looks like the
> initial write goes directly to the HttpServletResponse.responseStream....
> Perhaps it's a up to  auser to handle cases liek thise one ? For example,
> introduce a Servlet filter which would buffer the output stream, or
> directly write to HttpServletResponse which is available for both JAXWS and
> Thanks, Sergey

Daniel Kulp

View raw message