Greetings:
First let me say, in comparison to the first two books, this book is very nicely written.
I am trying to test a Restful WebService that is deployed by a thirdparty. Hence, I do not have the code for the Restful WebService on the server. I do however, have the payload classes of the response body; which in this case is WebServiceValue.class. I read all of Chapter 11; but it really didn't tell me how to wire up my Restful Client.
I am getting the following error:
org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [com.mycompany.model.WebServiceValue] and content type [text/xml;charset=UTF-8]
at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:77)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:446)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:206)
at com.mycompany.ws.client.OPA_CrossReferenceTest.testCrossReferenceForOPA(OPA_CrossReferenceTest.java:24)
The books says, in section 11.3.2, that "Spring comes a variety of message converters...". I took that to mean that, by default I didn't have to wire up the message converters, if I am using the message converters in the table listing.
So my question is do I have to wire up the MarshallingHttpMessageConverter; as I am using xstream?
|