I have one approach that is working using @Multipart (shown below), but I'd
ideally like a "regular" way to consume the service using jaxrs:client and
without possibly using the concept of "attachments".
Approach that is working:
@POST
@Path("/postdata3")
@Consumes("multipart/mixed")
@Produces("application/json")
public String postData3(@Multipart(value = "testItem1", type =
"application/json") TestItem t1,
@Multipart(value = "testItem2", type = "application/json") TestItem
t2
);
WebClient client =
WebClient.create("http://myserver/services/test/postdata3");
client.type("multipart/mixed").accept("application/json");
List<Attachment> atts = new LinkedList<Attachment>();
atts.add(new Attachment("testItem1", "application/json", t1));
atts.add(new Attachment("testItem2", "application/json", t2));
javax.ws.rs.core.Response s = client.postCollection(atts,
Attachment.class);
System.out.println(s.getStatus());
--
View this message in context:
http://cxf.547215.n5.nabble.com/Resource-method-has-more-than-one-parameter-representing-a-request-body-tp5550174p5550429.html
Sent from the cxf-user mailing list archive at Nabble.com.