Hi

It is really up to you how to represent the incoming and outgoing documents. As far as HTTP is concerned you can send them in a 'regular' HTTP body or as multipart attachments, the choice is likely to be done depending on how you expect the clients to interact with your service.
If you are interested in working with multiparts, see

http://cxf.apache.org/docs/jax-rs-multiparts.html

Cheers, Sergey
On 19/06/14 09:32, priya wrote:
Hello,

I am developing a rest based webservice where I need to be able to send and
receive documents from a resource method. My resource method looks like
this:

         @Path("/generateDocument/")
        @Consumes("application/xml")
        @Produces("application/xml")
        public ResultType generateDocument(DocumentParameters 
documentParameters);

I have attached ResultType and DocumentParameters classes (which are
generated by JAXB) for reference.

I am not sure if this is the correct way of doing it. I have a feeling that
using multipart support could be a better way of doing it. But I am not sure
how to use it. Please let me know how I can use multipart here and if it is
really needed.

Thanks a lot,
Priya ResultType.java
<http://cxf.547215.n5.nabble.com/file/n5745338/ResultType.java>
DocumentParameters.java
<http://cxf.547215.n5.nabble.com/file/n5745338/DocumentParameters.java>



--
View this message in context: 
http://cxf.547215.n5.nabble.com/Best-way-to-send-and-receive-a-document-from-a-resource-method-in-rest-based-webservice-tp5745338.html
Sent from the cxf-user mailing lis

Reply via email to