[Moims-dai] JSON and/or XML

david at giaretta.org david at giaretta.org
Tue Nov 22 16:52:59 UTC 2022

Hi Steve


At the end of the call today we spoke about JSON and/or XML.


I realised that I am just writing very simple POJOs (Plain Old Java
Objects), with Jackson annotations to serialise and de-serialise to/from
JSON, but one can do exactly the same conversions to XML using JAXB


Unless the annotations interact in some way - which is always possible - one
can use the same code with both sets of annotations in and then when one
chooses which serialisation - JSON or XML - to use then one calls one or
other specific methods in the Generic Adapter.


This would allow us - assuming the annotations work together OK - to mix and
match XML and/or JSON serialisations.

The Switchboard tells us which one the other side prefers BUT since the HTTP
headers tell us whether we are receiving XML or JSON then it does not

The only thing we need to do in the BB is

1.	Ensure the switchboard has the preferred serialisation (although as
mentioned this may not strictly be necessary) and
2.	In the BB specify the serialisation for XML in a similar way to JSON
- of course this does limit the XML that is sent but at least it is XML.


What do you think?





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ccsds.org/pipermail/moims-dai/attachments/20221122/c611e69d/attachment.htm>

More information about the MOIMS-DAI mailing list