cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glynn, Eoghan" <>
Subject RE: Flush Problem with HTTPCondit
Date Thu, 21 Sep 2006 14:53:28 GMT

> -----Original Message-----
> From: Dan Diephouse [] 
> Sent: 21 September 2006 15:31
> To:
> Cc: Li, Tao (Tom)
> Subject: Re: Flush Problem with HTTPCondit
> Glynn, Eoghan wrote:
> >Hi Tom,
> >
> >Well the current Conduit/CachedOutputStream model assumes 
> that when the 
> >first flush() call is made during the outgoing interceptor chain 
> >traversal, the message content is effectively "frozen" in the sense 
> >that it can written onto the "real" output stream provided by the 
> >transport layer.
> >
> >Currently, as you say, this first flush() normally occurs in the 
> >SoapOutInterceptor after it has written the message body. However, I 
> >was thinking that in the normal case (i.e. in the absence of 
> >payload-transforming interceptors like Gzip) that we should 
> change this 
> >so that the initial flush() occurs before the envelope is 
> written (so 
> >that the SOAP envelope is streamed directly onto the wire, 
> to avoid the 
> >overhead of caching and copying).
> >
> >  
> >
> +1 - although, why not have the tranforming interceptors add 
> the cached
> stream themselves if they need it as opposed to adding it at 
> the transport level?

Because in the absence of a transforming interceptor, some transports
may still need some minimal caching or deferral of the "real" output
stream creation. 

For example to allow an interceptor [sitting in the chain between the
MessageSenderInterceptor & the interceptor that calls flush(), e.g. a
JAX-WS LogicalHandler] to set a HTTP-level message header ...
URLConnection.addRequestProperty() fails with IllegalStateException or
some-such if called *before* URLConnection.getOutputStream(), so the
real output stream creation must be deferred until transport-level
headers may no longer be set.

The transport-level wrapper output stream would probably become more of
a mechanism to defer creation of the real output stream, rather than
doing much, if any, caching. Depends on exactly where the first flush
occurs ... e.g. after the SOAP headers are written, but before the body,
or even before any of the SOAP envelope is written.


> - Dan
> -- 
> Dan Diephouse
> (616) 971-2053
> Envoi Solutions LLC

View raw message