Hi Sergey,

I have discovered one difference in processing of mutipart body by client proxy 
after migration to CXF 3:

1. Server method described by following interface (generated from WADL):
  @GET
  @Produces("multipart/mixed")
  @Path
  Response getSomething();

2. Implementation :
  Response getSomething() {
           MyResponse myResponse;// init it here
           List<Attachment> attachments = new LinkedList<>();
           attachments.add(new Attachment("response", 
MediaType.APPLICATION_XML_TYPE.toString(), myResponse));
          // it can be added other attachments 
          return Response.ok().entity(attachments).build();
  }

3.  On client side we create service proxy for calling the method
    final T serviceProxy = JAXRSClientFactory.create(baseURL + serviceURL, 
serviceClass, new ArrayList<>(), features, null);
    Response response = serviceProxy.getSomething();
    MyResponse myResponse = response.readEntity(MyResponse.class);

It works for CXF 2.7.11, but for CXF 3.1.7 we get following exception:
javax.ws.rs.client.ResponseProcessingException: No message body reader has been 
found for class MyResponse, ContentType: 
multipart/mixed;boundary="uuid:e7578110-29f1-4125-848e-dc9230887d45".

For CXF 3.1.7 code works without problems if we use Client API to read set of 
attachments.

Do you have any ideas why it works differently? It is not a big issue, because 
WebClient / Client API works - anyway interesting to understand the difference.

Regards,
Andrei.

Reply via email to