Java 8, Spring 5.x
Given
ResponseEntity<Object> responnse = restTemplate.exchange( myUrl, HttpMethod.GET, reqquest, Object.class);
returns some XML
<LinkedHashMap>
<Entity>
<name>Person</name>
<href>../12345</href>
<Attribute>
<name>lastName</name>
<type>String</type>
<value>Nixon</value>
</Attribute>
<Attribute>
<name>firstName</name>
<type>String</type>
<value>Dick</value>
</Attribute>
</Entity>
</LinkedHashMap>
and
@JsonIgnoreProperties(ignoreUnknown=true)
@JacksonXmlRootElement(localName="Person")
@Entity
public class Person implements java.io.Serializable {
private static final long serialVersionUID = 123456789L;
@Id
private Long id;
private String lastName;
private String firstName;
...
}
how do I adjust this to where I can
if( responnse.hasBody()){
Person person = xmlMapper.readValue( responnse.getBody(), Person.class);
...
}
I'm think xmlMapper needs some customizing to handle the id, at the least.
TIA,
Still-struggling Steve