A message body writer for Java type, class myPackage.B, and MIME media type, application/octet-stream, was not found

后端 未结 10 1407

I am new at RESTful webservices and was trying to update my @OneToMany relationship from a standalone client application, but I am not able to do that. I am usi

10条回答
  •  粉色の甜心
    2020-11-29 07:06

    You have to do two things to remove this error.

    1. The @xmlElement mapping in the model
    2. The client side:

      response = resource.type(MediaType.APPLICATION_XML).put(ClientResponse.class, b1); //consume

      or

      response = resource.accept(MediaType.APPLICATION_XML).put(ClientResponse.class, b1); //produce

提交回复
热议问题