title: @xmlrootelement json equivalent
body: <p>This is the class that I use to populate and send it as a part of my web service request call:</p>
  
  <pre><code>import javax.xml.bind.annotation.XmlRootElement;
  
  @XmlRootElement
  public class ClientInfo {
  
      private String langCode;
      private String userId;
      private String password;
      private String ShipTo;
      private String timeZone;
      public String getLangCode() {
          return langCode;
      }
      public void setLangCode(String langCode) {
          this.langCode = langCode;
      }
      public String getUserId() {
          return userId;
      }
      public void setUserId(String userId) {
          this.userId = userId;
      }
      public String getPassword() {
          return password;
      }
      public void setPassword(String password) {
          this.password = password;
      }
      public String getShipTo() {
          return ShipTo;
      }
      public void setShipTo(String shipTo) {
          ShipTo = shipTo;
      }
      public String getTimeZone() {
          return timeZone;
      }
      public void setTimeZone(String timeZone) {
          this.timeZone = timeZone;
      }
  
  }
  </code></pre>
  
  <p>When I am using <code>Entity.xml()</code> for this class to parse the class and initiate the request everything works fine, and I get the result back, this is part of the code for service invocation. Please look at the last line for <code>Entity.xml()</code>;</p>
  
  <pre><code>import javax.ws.rs.client.Client;
  import javax.ws.rs.client.ClientBuilder;
  import javax.ws.rs.client.Entity;
  import javax.ws.rs.client.Invocation;
  import javax.ws.rs.client.WebTarget;
  import javax.ws.rs.core.MediaType;
  import javax.ws.rs.core.Response;
  
  import org.glassfish.jersey.client.ClientConfig;
  
  ClientInfo ci = new ClientInfo();
  ci.setLangCode("en");
  ci.setPassword("password@123");
  ci.setShipTo("0000");
  ci.setTimeZone("420");
  ci.setUserId("user1");
  Invocation.Builder invocationBuilder = resourceWebTarget.request(MediaType.APPLICATION_XML);
  Response response = invocationBuilder.post(Entity.xml(ci));
  </code></pre>
  
  <p>However, if I change the <code>Entity.xml(ci)</code> to <code>Entity.json(ci)</code>, it will throw me an exception. The exception is as follow:</p>
  
  <pre><code>Apr 07, 2014 3:54:08 PM org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor aroundWriteTo
  SEVERE: MessageBodyWriter not found for media type=application/json, type=class com.sheidaei.sample.appleclient.ClientInfo, genericType=class com.sheidaei.sample.appleclient.ClientInfo.
  </code></pre>
  
  <p>From what I read, my understanding is that the application can not find a JSON representation for the ClientInfo class. Is there an easy way (such as annotation) so that Entity.json() finds the JSON representation of the ClientInfo easily? </p>