title: Apache Camel: ProducerTemplate not unmarshalling the response
body: <p>Camel version: 2.15.6</p>
  
  <p>I used the ProducerTemplate to send a http request and get the response like this.</p>
  
  <pre><code>from("direct:getContact")
  .process(new Processor() {
                      @Override
                      public void process(Exchange exchange) throws Exception {
                          CamelContext context = exchange.getContext();
                          ProducerTemplate producerTemplate = context.createProducerTemplate();
  Contact contact = producerTemplate.requestBodyAndHeaders( 
                                  "http://localhost:8080/api/contact/2345", 
                                  null, headers, Contact.class); 
  
  logger.info("Contact is: " + new ObjectMapper().writeValueAsString(contact)); 
  
  exchange.getOut().setBody(contact);
  
  });
  </code></pre>
  
  <p>I get the contact as null. </p>
  
  <p>When I try to get it as Object like this: </p>
  
  <pre><code>Object contact = producerTemplate.requestBodyAndHeaders( 
                                  "http://localhost:8080/api/contact/2345", 
                                  null, headers); 
  
  
  logger.info("Contact is: " + new ObjectMapper().writeValueAsString(contact)); 
  </code></pre>
  
  <blockquote>
    <p>com.fasterxml.jackson.databind.JsonMappingException: No serializer
    found for class
    org.apache.camel.converter.stream.CachedOutputStream$WrappedInputStream
    and no properties discovered to create BeanSerializer (to avoid
    exception, disable SerializationFeature.FAIL_ON_EMPTY_BEA</p>
  </blockquote>
  
  <p>NS) ) </p>
  
  <p>Why is ProducerTemplate not able to unmarshall the response to the specified object? 
  How can this be achieved? </p>
  
  <p><strong>Edit</strong></p>
  
  <p>The Fix I observed is as follows:
  If I first get the output as string and then deserialize it, it works.</p>
  
  <pre><code>String responseString = producerTemplate.requestBodyAndHeaders( 
                                      "http://localhost:8080/api/contact/2345", 
                                      null, headers, String.class); 
  
  Contact contact = new ObjectMapper().readValue(responseString, Contact.class);
  </code></pre>