I am trying to deserialize a message being recieved in an XML soap format. Previously this had been working but due to a change to the source message I am now getting the following issue
Can not deserialize instance of java.lang.String out of START_OBJECT token
I can see that this because of the following in the message....
<FieldExample xsi:type="xsd:string"></FieldExample>
I believe the issue is that it is trying to assign or "cast" an string datatype onto an empty field and so is throwing an error stating that the field is an object and cannot be recognized as a string.
My question is how can I stop the deserializer from trying to read this particular empty field in the first place. This is how I've declared in my Java code using Jackson
@JacksonXmlProperty(localName = "FieldExample", namespace = Namespace.example)
private String fieldExample;
I have tried the following to no success....
@JsonInclude(JsonInclude.Include.NON_EMPTY)
on the class definition
and
MAPPER.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
On the mapper creation
Unfortunately the issue still occurs.