Skip to content
Advertisement

JaxbDto Serialization and deserialization

I need to receive some message with SOAP so I’ve generated a few classes by xsd-scheme and maven-jaxb2-plugin like this:

JavaScript

After receiving message I need to send these to the next one microservice in wrap of HashMap. I supposed to use ObjectMapper to convert:

JavaScript

But the generated classes are haven’t any constructors so I got the exception like “

No creator like default constructor are exists”.

What is the best preactice to work with Jaxb Dto? Can I do smth to successful convert these json to object? Thanks in advance!

Advertisement

Answer

I’ve solved my problem by using ObjectMapper MixIn:

JavaScript

And the convertation:

JavaScript

solution link

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement