I would like to implement a webservice with cxf to upload a file with some informations about it contained in the body.
What I've done but didn't work yet :
@POST
@Path("/")
@Consumes(MediaType.MULTIPART_FORM_DATA)
User addDocument(
@Multipart(value="metadata", type="application/json") DocMeta metadata,
@Multipart(value="inputstream", type="multipart/form-data") InputStream inputStream)
throws ObjectAlreadyExistsException;
When I try to request my service with curl it doesn't work :
curl http://localhost:9090/...
--X POST
-H"Content-Type:multipart/form-data"
-F inputstream=@myFile.txt
-d'{"info1":"info1","info2":"info2"}'
Is it really possible to have both multipart data and a json body with cxf ??
Thanks by advance
Manu