Actually, when writing attachements, you can probably return JAXRS StreamingOutput, though returning OutputStream should also do
well enough, I haven't done much testing yet in this area so not sure yet which option will perform better
cheers, Sergey
----- Original Message -----
From: "Sergey Beryozkin" <[email protected]>
To: <[email protected]>
Cc: "rsmith" <[email protected]>
Sent: Friday, October 09, 2009 1:12 PM
Subject: Re: CXF and large XML request/responses : streaming support?
Hi
It is interesting, especially the Stax support.I'm not familiar with the
recent build of CXF, on this matter would it be also available for the
JAX-RS support.
I missed it...I think in the case of JAXRS declaring a method accepting (JAXP)
Source will work once
I update a SourceProvider to check if XMLStreamReader is available on the message (or create a new one if it is a multipart
request) and then wrap it in StaxSource and just pass it on - will be done for 2.3; if you need it working now then I can help you
with creating a custom SourceProvider...The existing MultipartProvider will just delegate to it.
thanks, Sergey
Anyway great framework :)
On Thu, Oct 8, 2009 at 19:29, Daniel Kulp <[email protected]> wrote:
Right now, with a JAX-WS provider, there is SOME support for this, but its
far
from ideal. This is an area I'll be working in next week (resolving
customer
issues) and I'll see if I can add some enhancements easily enough.
Basically, right now, if you do Provider<Source>, you would get DOMSource
in
(thus, the incoming message would not be streamed, but you could return a
StreamSource or SAXSource orsimilar to use that we would use to copy stuff
out. If you did Provider<StreamSource> or Provider<SAXSource>, we pull
the
full message into a Cached stream (which, for large messages, would output
to
temp files on disks) and return that to you. Thus, the whole thing isn't
in
memory, but it does result in the temp files and such.
Part of what I hope to do next week is enable:
Provider<XMLStreamReader>
and/or
Provider<StaxSource>
which would allow full streaming in most cases.
Dan
On Wed October 7 2009 12:37:50 am rsmith wrote:
> I'm trying to find out if CXF supports full streaming of input and output
> messages for the SOAP transport.
>
> I have a service that will be receiving large input XML payload, and will
> be generating a response with a large XML payload. I can process the
> input XML incrementally, generating the response as the input is
> processed.
>
> Is there a way to implement a service in CXF streaming at all levels (XML
> parsing, data binding, generating response), avoiding holding the full
> document in memory at any time?
>
> I found several threads on the mailing list, some of which make it sound
> like it's supported. This message gave me the impression it may not
> currently be supported though:
>
http://www.nabble.com/Re%3A-Configuring-streaming-web-services%3A-error-on-
> the-call-to-invoke-p24187339.html
>
> Some of the other threads:
>
http://www.nabble.com/Looking-for-a-solution-for-Large-XML-Messages---strea
> ming-and-JAXWS-td20451942.html#a20451942
>
http://www.nabble.com/Recommended-way-to-have-a-web-method-stream-results-
> back-to-client--td22856243.html#a22864087
> http://www.nabble.com/SAXSource-td24411461.html#a24411461
>
> Thanks in advance
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog
--
Bryce