You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Unmarsalling from XML to JSON it's not converting to the xsi:type, You can see the sample code here
This is the XML I have tried, <Well xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.namespace1.com"> <Aliases xmlns="http://www.defaultnamespace.com"> <Description>Identifier is created from the uid of the input scheme</Description> </Aliases> <ReferencePoint> <Location xsi:type="ProjectedWellLocation"> <Description>Location of well surface point in projected system.</Description> <Coordinate1>coordinate</Coordinate1> </Location> </ReferencePoint> </Well>
Here Location is marked with xsi:type="ProjectedWellLocation", but the JSON output its converted as its base type "AbstractWellLocation". If I removed the "Aliases" section then it's working correctly. so the issue is happening when there is defaultElementNamespace referenced.
After debugging the issue found that here failing to get the xsiTypeInfo, because of namespaceContext.getNamespaceURI(prefix) giving wrong namespace from Jsonix.Schema.XSD.QName.INSTANCE.parse()
The text was updated successfully, but these errors were encountered:
When Unmarsalling from XML to JSON it's not converting to the xsi:type, You can see the sample code here
This is the XML I have tried,
<Well xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.namespace1.com"> <Aliases xmlns="http://www.defaultnamespace.com"> <Description>Identifier is created from the uid of the input scheme</Description> </Aliases> <ReferencePoint> <Location xsi:type="ProjectedWellLocation"> <Description>Location of well surface point in projected system.</Description> <Coordinate1>coordinate</Coordinate1> </Location> </ReferencePoint> </Well>
Here Location is marked with xsi:type="ProjectedWellLocation", but the JSON output its converted as its base type "AbstractWellLocation". If I removed the "Aliases" section then it's working correctly. so the issue is happening when there is defaultElementNamespace referenced.
After debugging the issue found that here failing to get the xsiTypeInfo, because of namespaceContext.getNamespaceURI(prefix) giving wrong namespace from Jsonix.Schema.XSD.QName.INSTANCE.parse()
The text was updated successfully, but these errors were encountered: