title: Unable to fetch response using Retrofit2 + RXJava2 but fetching response in POSTMAN
body: <p>I am trying to fetch JSON response from the server for networking I am using Retrofit2 and Rxjava2 to fetch data from the server. Below is my JSON response from the server.</p>
  <pre><code>{
  &quot;status&quot;: &quot;Success&quot;,
  &quot;panHolderName&quot;: &quot;xxxxxx&quot;,
  &quot;dateOfBirth&quot;: &quot;xx-xx-xxxx&quot;,
  &quot;gender&quot;: &quot;xxx&quot;,
  &quot;residence&quot;: null,
  &quot;occupation&quot;: &quot;xxxx&quot;,
  &quot;address&quot;: &quot;xxxxxxx&quot;,
  &quot;pincode&quot;: &quot;xxxxxx&quot;
  }
  </code></pre>
  <p>When I am using API in POSTMAN it is fetching above response properly but when I am using RXJAva2 and retrofit to fetch response it is showing <code>panHolderName</code> field only even if there is no error showing. Why other fields data is not showing up.</p>
  <p>below is my code</p>
  <p><strong>RetrofitClient.class</strong></p>
  <pre><code>public class RetrofitClient {
  
  private static Retrofit retrofit = null;
  
  public static Retrofit getInstance(){
  
      OkHttpClient okHttpClient = new OkHttpClient.Builder()
              .connectTimeout(22, TimeUnit.SECONDS)
              .readTimeout(22, TimeUnit.SECONDS)
              .writeTimeout(22, TimeUnit.SECONDS)
              .build();
  
      if(retrofit == null)
          retrofit = new Retrofit.Builder()
                  .baseUrl(&quot;http://68.169.58.46:8080/portal/androidIntegrationAPI/&quot;)
                  .addConverterFactory(GsonConverterFactory.create(new GsonBuilder().setLenient().create()))
                  .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                  .client(okHttpClient)
                  .build();
  
      return retrofit;
    }
  
  }
  </code></pre>
  <p><strong>ApiService.class</strong></p>
  <pre><code>public interface ApiService {     
  
               @POST(&quot;getPanDetails&quot;)
               Observable&lt;PanDetails&gt; getDetails(@Body JsonObject jsonObject);
           }
  </code></pre>
  <p><strong>PanDetails.class</strong></p>
  <pre><code>public class PanDetails {
  
  @SerializedName(&quot;status&quot;)
  @Expose
  String status;
  
  @SerializedName(&quot;panHolderName&quot;)
  @Expose
  String panHolderName;
  
  @SerializedName(&quot;dateOfBirth&quot;)
  @Expose
  String dateOfBirth;
  
  @SerializedName(&quot;gender&quot;)
  @Expose
  String gender;
  
  @SerializedName(&quot;residence&quot;)
  @Expose
  String residence;
  
  @SerializedName(&quot;occupation&quot;)
  @Expose
  String occupation;
  
  @SerializedName(&quot;address&quot;)
  @Expose
  String address;
  
  @SerializedName(&quot;pincode&quot;)
  @Expose
  String pincode;
  
  public PanDetails(String status, String panHolderName, String dateOfBirth, String gender, String residence,
                    String occupation, String address, String pincode) {
      this.status = status;
      this.panHolderName = panHolderName;
      this.dateOfBirth = dateOfBirth;
      this.gender = gender;
      this.residence = residence;
      this.occupation = occupation;
      this.address = address;
      this.pincode = pincode;
  }
  
  public String getStatus() {
      return status;
  }
  
  public void setStatus(String status) {
      this.status = status;
  }
  
  public String getPanHolderName() {
      return panHolderName;
  }
  
  public void setPanHolderName(String panHolderName) {
      this.panHolderName = panHolderName;
  }
  
  public String getDateOfBirth() {
      return dateOfBirth;
  }
  
  public void setDateOfBirth(String dateOfBirth) {
      this.dateOfBirth = dateOfBirth;
  }
  
  public String getGender() {
      return gender;
  }
  
  public void setGender(String gender) {
      this.gender = gender;
  }
  
  public String getResidence() {
      return residence;
  }
  
  public void setResidence(String residence) {
      this.residence = residence;
  }
  
  public String getOccupation() {
      return occupation;
  }
  
  public void setOccupation(String occupation) {
      this.occupation = occupation;
  }
  
  public String getAddress() {
      return address;
  }
  
  public void setAddress(String address) {
      this.address = address;
  }
  
  public String getPincode() {
      return pincode;
  }
  
  public void setPincode(String pincode) {
      this.pincode = pincode;
  }
  }
  </code></pre>
  <p><strong>PersonalInfo.class</strong></p>
  <pre><code>  private void sendPan(String str1){
  
      Retrofit retrofit = RetrofitClient.getInstance();
      ApiService apiService = retrofit.create(ApiService.class);
  
      JsonObject jsonObject = new JsonObject();
      jsonObject.addProperty(&quot;panNo&quot;,str1);
  
      apiService.getDetails(jsonObject).subscribeOn(Schedulers.io())
                                       .subscribe(new Observer&lt;PanDetails&gt;() {
                                           @Override
                                           public void onSubscribe(Disposable d) {
  
                                           }
  
                                           @Override
                                           public void onNext(PanDetails value) {
  
                                                   prg.dismiss();
  
                                                   name.setText(value.getPanHolderName());
                                                   Log.d(&quot;name&quot;,nam);
                                                   mydob.setText(value.getDateOfBirth());
                                                   address.setText(value.getAddress());
                                                   pin.setText(value.getPincode());
                                                   if(value.getGender().equals(&quot;Male&quot;)){
                                                       gender.setSelection(1);
                                                   }
                                                   else{
                                                       gender.setSelection(2);
                                                   }
  
                                            
                                           }
  
                                           @Override
                                           public void onError(final Throwable e) {
  
                                                     runOnUiThread(new Runnable() {
                                                         @Override
                                                         public void run() {
                                                             prg.dismiss();
                                                             TastyToast.makeText(getApplicationContext(),e.getMessage(),
                                                                     TastyToast.LENGTH_LONG,TastyToast.INFO).show();
                                                         }
                                                     });  
  
  
                                           }
  
                                           @Override
                                           public void onComplete() {
  
                                           }
                                       });
  }
  </code></pre>
  <p>Someone, please let me know what I am doing wrong. Any help would be appreciated.</p>
  <p><strong>THANKS</strong></p>