I am using Spring Boot 1.5.4 version . I am using spring-ws getWebServiceTemplate() to make a webservice call. The SOAP response has lot of null values for the fields.
I am trying to filter out the null values in the JSON response. None of the following approaches seem to work:
- Setting the property in the
application.properties:
spring.jackson.default-property-inclusion:NON_NULL`
- Setting it in Configuration class using
Jackson2ObjectMapperBuilder:
@Bean
public Jackson2ObjectMapperBuilder objectMapperBuilder() {
Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder();
builder.serializationInclusion(JsonInclude.Include.NON_NULL);
builder.serializationInclusion(JsonInclude.Include.NON_EMPTY);
return builder;
}
Please advise.
lva