1. Are you ready for the Galaxy S20? Here is everything we know so far!

Jackson mapper, Spring Android and https not marshalling

Discussion in 'Android Development' started by Vishenzo, Oct 24, 2014.

  1. Vishenzo

    Vishenzo Lurker
    Thread Starter

    I m actually trying to developp a little application which has to receive data from a REST secured API. I m using Spring Android (Spring for Android) to make it in an easy way.

    I have used this framework before on standard HTTP REST API and it worked great. But now, it seems that I have a problem with:

    this.mRestTemplate = new RestTemplate();
    this.mRestTemplate.getMessageConverters().add(new StringHttpMessageConverter());
    this.mRestTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());

    Explanations :

    If I add the StringHTTPMessagerConverter I can get the full JSON result on a String format on HTTP & HTTPS
    If I add the MappingJackson2HttpMessageConverter, I can get the json and a full object marshalled corresponding(on HTTP), but on HTTPS, it seems that the code is blocking on :

    ResponseEntity responseEntity = mRestTemplate.exchange(BASE_URL + ws, HttpMethod.GET, getRequestEntity(), ContainerAnomalie.class);

    NB : ContainerAnomalie extends ArrayList NB2 : My API Key is okay, I can get the full JSON in a String object, and I can display it on a browser using the request URL

    There are no errors displayed in the logcat...

    Do you have an idea ?

    Thanks for advance,

    1. Download the Forums for Android™ app!


Similar Threads - Jackson mapper Spring
  1. sullencab

Share This Page