Hi Kynan
I'd probably go with multiparts, CXF is very efficient in the way it deals with attachments, every part will be represented by an
individual stream, if the part is too large then it will be saved to the disk, etc...
I'm sorry I haven't properly documented how to use attachments in CXf JAX-RS, I only posted to my blog once. I'm so slow in updating
the docs. Here's a system test :
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSMultipartTest.java
(tests)
http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jaxrs/MultipartStore.java
(resource class)
The limitation is that multiparts are not supproted by the client api - I have
this JIRA for it :
http://issues.apache.org/jira/browse/CXF-2270
Let me know please if using multiparts can be of interest
cheers, Sergey
----- Original Message -----
From: "Kynan Fraser" <[email protected]>
To: <[email protected]>
Sent: Monday, July 06, 2009 9:03 AM
Subject: Re: JAX-RS: Best approach for POST operation of a complex type
containing binary object
Forgot to mention i've got no problem with byte[]'s in the XML but i'd prefer
to use streams if possible. I'm not sure if there is a way to have streams
inside the XML, or if its better to use attachments/multipart instead?
Regards,
Kynan
Kynan Fraser wrote:
Hi All,
My use case is I need to support a POST operation for clients to send an
XML representation of a complex type (like a mail) containing a mix of
strings and (multiple) binary objects (mail attachments).
I can handle a post just containing a single binary as an input stream or
byte[], or the XML by itself easily enough, but I'm not sure of the best
way to handle them side by side and also multiple binary objects (ideally
streams?) instead of just one inside the xml complex type. Should they be
base64 encoded binary objects inside the XML? Attachments?
I've read a bit about jaxrs support for multiparts but i'm not sure if
thats my best option... any help/direction is appreciated.
Thanks,
Kynan
--
View this message in context:
http://www.nabble.com/JAX-RS%3A-Best-approach-for-POST-operation-of-a-complex-type-containing-binary-object-tp24350931p24351262.html
Sent from the cxf-user mailing list archive at Nabble.com.