I'am trying to deserialize xml that contains a base64 encoded tag into an object
This is an example of the api response data :
<WebResponse>
<RequestId>6541635537</RequestId>
<Items>
<Item>
<Id>1aSd</Id>
<Name>spider</Name>
</Item>
<Item>
<Id>2sze</Id>
<Name>catman</Name>
</Item>
</Items> <Customer>PEN1c3RvbWVyPg0KIDxOYW1lPk5pY288L05hbWU+DQogPEFjY291bnRzPg0KICA8QWNjb3VudD4NCiAgIDxUeXBlPlBSTzwvVHlwZT4NCiAgPC9BY2NvdW50Pg0KICA8QWNjb3VudD4NCiAgIDxUeXBlPlBST01BWDwvVHlwZT4NCiAgPC9BY2NvdW50Pg0KIDwvQWNjb3VudHM+DQo8L0N1c3RvbWVyPg==</Customer>
</WebResponse>
If you decode the Customer block, you will get :
<Customer>
<Name>Nico</Name>
<Accounts>
<Account>
<Type>PRO</Type>
</Account>
<Account>
<Type>PROMAX</Type>
</Account>
</Accounts>
</Customer>
What i want to do, is to decode the Customer block first before serialization.
this is what i have tried to do so fare :
ObjectMapper MAPPER = new XmlMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
WebResponse result = MAPPER.readerFor(WebResponse.class).readValue(webResponse);
I have got this excepting while giving a try : Exception in thread "main" com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of org.Customer (although at least one Creator exists): no String-argument
Any hints are welcome. This is the classes : link => MainMapper.class has the main method to launch the test.
Thank you