Hi,

We have a current application that uses a CXF based SOAP interface that returns 
a large file using a DataHandler.  The resulting generated code allows the 
client to access the file represented by the DataHandler as a stream.

I am looking for an equivalent approach using a JAX-RS based service using JSON 
(specifically Jackson) in a spring boot application.  To date, I have tried 
several approaches and am not satisfied with them.


  *   Serializing the file to a byte array returned in the JSON.  This is not 
appropriate for a number of reasons, response can’t be initiated until after 
file converted to byte array, response can’t be processed until entire file is 
received, memory usage, etc…
  *   Sending a multipart response.  Better, but requires the client to know 
how to deal with multiparts and how to re-assemble the response object 
correctly.  Unfortunately, I can’t trust that the client systems will be able 
to do this appropriately.
  *   Send an XML response with XOP support.  This is the closest think I’ve 
found so far, but unfortunately, it’s XML, not JSON and there are some things 
we’re trying to do with Jackson and JSON that make this a non-starter.

Any ideas or are we out of luck?

Thanks,

John Shipman
Booz | Allen | Hamilton - Charleston Hub
Tech Lead – VBMS Correspondence Team
843-806-6480 | [email protected]<mailto:[email protected]>

Reply via email to