title: CXF: No message body writer found for class - automatically mapping non-simple resources
body: <p>I am using the CXF rest client which works well for simple data types (eg: Strings, ints). However, when I attempt to use custom Objects I get this:</p>
  
  <pre><code>Exception in thread "main" org.apache.cxf.interceptor.Fault: .No message body writer found for class : class com.company.datatype.normal.MyObject.
      at org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:523)
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:438)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:177)
      at $Proxy13.execute(Unknown Source)
      at com.company.JaxTestClient.main(JaxTestClient.java:26)
  Caused by: org.apache.cxf.jaxrs.client.ClientWebApplicationException: .No message body writer found for class : class com.company.datatype.normal.MyObject.
      at org.apache.cxf.jaxrs.client.AbstractClient.reportMessageHandlerProblem(AbstractClient.java:491)
      at org.apache.cxf.jaxrs.client.AbstractClient.writeBody(AbstractClient.java:401)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.handleMessage(ClientProxyImpl.java:515)
      ... 5 more
  </code></pre>
  
  <p>I'm calling it like this:</p>
  
  <pre><code>JaxExample jaxExample = JAXRSClientFactory.create( "http://localhost:8111/", JaxExample.class );
  MyObject before = ...
  MyObject after = jaxExample.execute( before );
  </code></pre>
  
  <p>Here is the method in the interface:</p>
  
  <pre><code>@POST
  @Path( "execute" )
  @Produces( "application/json" )
  MyObject execute( MyObject myObject );
  </code></pre>
  
  <p>The restlet library does this quite simply, by adding the XStream dependency to your path it "just works". Does CXF something similar?</p>
  
  <p><strong>EDIT #1:</strong></p>
  
  <p>I've posted this as a feature improvement to the CXF issue management system <a href="https://issues.apache.org/jira/browse/CXF-3617" rel="noreferrer">here</a>. I can only hope this will get attended to.</p>