i need disable chunking in cxf webservice on server-side clients need 'content-length' header in response. can see 'transfer-encoding' 'chunked' in server response , no 'content-length' header sent.
i've found chunkins can disabled in spring's context this:
<http-conf:conduit name="*.http-conduit"> <http-conf:client receivetimeout=“300000“ allowchunking="false"/> </http-conf:conduit> since i'm creating services programmatically this:
// media service object mediaservice = new mediaservice(); system.out.println("starting media service #1 ..."); endpointimpl mediaep = (endpointimpl)endpoint.create(mediaservice); mediaep.publish("http://localhost:8081/onvif/media_service"); how can it?
actually, can't easyly specified not allow chuncking server side. indeed, it's client pb! understand have client of ws can't modify code desactivate chunking?
you have : write cxf interceptor replace servlets outputstream in message buffer of sort (bytearrayoutputstream or cachedoutputstream) @ beginning of output chain , @ end of chain, use set content-length header on response , copy data real output stream. indeed, content lenght force framework not use chunking.
i did once before. i'll try post maybe tomorrow code of such interceptor.
Comments
Post a Comment