Question

Is it possible to return a List<String> as a JAXB response directly without wrapping it in a response object? E.g.,

public List<String> foo(Bar bar) {
    return restTemplate.postForEntity("http://foo.com/bar", bar, List.class);
}

Currently I get the error

Could not write request: no suitable HttpMessageConverter found for request type [my.pkg.Bar]

The HttpMessageConverters are properly configured as other GET/POST requests with Bar works.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top