I am trying to use Spring RestTemplate to retrieve employee list entries, for example:
public List<Employee> getEmployeesByFirstName(String firstName) { return restTemplate.getForObject(employeeServiceUrl + "/firstname/{firstName}", List.class, firstName); }
The problem is that web services (called) return the following XML format:
<employees> <& employee GT; .... </employee> <& employee GT; .... </employee> <& / employees GT;
Therefore, when executing the above method, the following error occurs:
org.springframework.http.converter.HttpMessageNotReadableException: Could not read [interface java.util.List]; nested exception is org.springframework.oxm.UnmarshallingFailureException: XStream unmarshalling exception; nested exception is com.thoughtworks.xstream.mapper.CannotResolveClassException: **employees : employees**
alvinegro
source share