I need to interact with a REST service that gives responses in XML. The structure of the XML document is as follows:

<RestcommResponse> <Clients> <Client> ... </Client> <Client> ... </Client> </Clients> </RestcommResponse> 

I use Spring with its RestTemplate class. Mapping with jackson-dataformat-xml. I would like to write the Client class, on the properties of which, using annotations, the elements of the Client node will be mapped, and in the RestTemplate response I will get a List. But the top two elements of the document bother me: RestcommResponse and Clients. How can you get around them?

  • get node \ xmlelement? - Senior Pomidor
  • Use jaxb and wrap customer data into a collection? - GenCloud
  • @GenCloud has now switched to this, but in general it is strange, I did not find the possibility of configuring such a simple matter with annotations (as is the case with json) - carapuz
  • Um, jaxb is the standard api configuration of "this case" by means of annotations - GenCloud

0