Sergey, 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. Dan On Wed March 4 2009 9:01:45 am Sergey Beryozkin wrote: > Hi, > > I'm looking at https://issues.apache.org/jira/browse/CXF-2051 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 > JAXRS ? > > Thanks, Sergey -- Daniel Kulp [email protected] http://www.dankulp.com/blog
