I am creating a SOAP service which receives XML input as below.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:inv="http://bac.com/wsdl/cbl.WCC/InvolvedPartyMaintenanceServicingV001" xmlns:inf="http://bac.com/xmlschema/osa/InfrastructureV003" xmlns:bac="http://bac.com/xmlschema/cbl/bac024">
<soapenv:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>*********</wsse:Username>
<wsse:Password>XXXXX</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<inv:combineInvolvedPartiesRequest>
<inv:osaRequestHeader>
<inf:providerService>
<inf:name>BCC</inf:name>
</inf:providerService>
</inv:osaRequestHeader>
<inv:involvedPartyRoleSummary xsi:type="bac:CustomerRoleSummary">
<bac:summarizedParty xsi:type="bac:IndividualSummary">
<bac:contactPreferences>
<bac:prefers xsi:type="bac:PostalAddress">
<bac:addressLine>TEST ADDRESS LINE ONE</bac:addressLine>
<bac:addressLine>TESTADDRESSTWO</bac:addressLine>
<bac:city>MMNAGAR</bac:city>
<bac:countryCode>US</bac:countryCode>
<bac:postalCode>68293-8000</bac:postalCode>
<bac:state>FL</bac:state>
</bac:prefers>
</bac:contactPreferences>
<bac:involvedPartyName xsi:type="bac:IndividualName">
<bac:firstName>KRISHNA</bac:firstName>
<bac:lastName>PRASAD</bac:lastName>
<bac:middleNames>M</bac:middleNames>
</bac:involvedPartyName>
<bac:birthDate>1981-08-28</bac:birthDate>
</bac:summarizedParty>
</inv:involvedPartyRoleSummary>
<inv:nonSurvivorPartyIdentifier xsi:type="bac:CustomerIdentifier">
<bac:identifier>34234234234</bac:identifier>
</inv:nonSurvivorPartyIdentifier>
<inv:survivorPartyIdentifier xsi:type="bac:CustomerIdentifier">
<bac:identifier>234234234234</bac:identifier>
<bac:subsystemIdentifier>BCC</bac:subsystemIdentifier>
<bac:systemIdentifier>0001</bac:systemIdentifier>
</inv:survivorPartyIdentifier>
</inv:combineInvolvedPartiesRequest>
</soapenv:Body>
</soapenv:Envelope>
This XML contains many "xsi:type" elements which represents the possible subtypes. When i try to convert this xml to json, i am not able to find subtypes (child classes) in dataweave transform component.
For example: "postaladdress" is subclass of "contactpoint" abstract class. In transform message component, fields from "contactpoint" is shown but fields from "postaladdress" is not shown for mapping.Therefore am not able to map fields in postaladdress class to json.
Kindly help me how to do mapping for this scenario?