title: JAX-RS Response Object displaying Object fields as NULL values
body: <p>First time implementing <code>JAX-RS Client API</code> in an application and I am having some small problems when it comes to storing the response data, which is returned as <code>JSON</code> as a Java BEAN. Refer to the following code snippets below which demonstrate how I have implemented it thus far.</p>
  
  <pre><code>object = client.target(uri).request().post(Entity.entity(requestObject, APPLICATION_JSON), Object.class);
  </code></pre>
  
  <p>Essentially, I would like to store the returned <code>JSON</code> response from the web service into my Java BEAN, which in this scenario is named <code>object</code>. <code>requestObject</code> is obviously the data which I am sending through to the web service, and I can confirm that POST does perform the operation successfully.</p>
  
  <p>After the line of code from the above example I have a simple: <code>object.toString();</code> call just to see the values currently stored within this <code>object</code>. However, when this executes and printed out to the console, all the <code>object</code> fields are printed out as <code>null</code>, which I do not understand why. I have annotated my Java BEAN class with the following <code>@XmlRootElement</code> above the class, although it still does not work. I do have another object nested as a variable in this Class, would that potentially be the reason why it does not correctly come through?</p>
  
  <p>As an example, this is what my JSON returned object looks like when I invoke the web service through CLI <code>curl</code>:</p>
  
  <pre><code>"response": {
          "description": "test charge",
          "email": "testing@example.com",
          "ip_address": "192.123.234.546",
          "person": {
              "name": "Matthew",
              "address_line1": "42 Test St",
              "address_line2": "",
              "address_city": "Sydney",
              "address_postcode": "2000",
              "address_state": "WA",
              "address_country": "Australia",
              "primary": null
          }
      }
  </code></pre>
  
  <p>Any reasons why this could be happening?</p>
  
  <p><strong>UPDATE</strong> [Response Bean Class Below]</p>
  
  <pre><code>@XmlRootElement(name = "response")
  public class ResponseObject {
  
      // Instance Variables
      private String description;
      private String email;
      private String ip_address;
      private Person person;
      // Standard Getter and Setter Methods below
  </code></pre>
  
  <p>Person Object which belongs to the <code>ResponseObject Class</code></p>
  
  <pre><code>@XmlRootElement
  public class Card {
  
      // Instance Variables
      private String name;
      private String address_line1;
      private String address_line2;
      private String address_city;
      private int address_postcode;
      private States address_state;
      private String address_country;
      private String primary;
      // Standard Getter and Setter Methods below
  </code></pre>