Would anyone have advice on how they create a vali...
# server
j
Would anyone have advice on how they create a valid xml data class for soap annotated xml body messages? https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/basic-serialization.md only seems to cover JSON and I cannot find any helpful info or docs on how to achieve this. A simple xml structure works fine, Getting more complex soap structures to parse successfully is proving a black spot for me. an example xml soap body would look like:
Copy code
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="<http://schemas.xmlsoap.org/soap/envelope/>" xmlns:xsd="<http://www.w3.org/2001/XMLSchema>" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>">
   <soapenv:Body>
        <sdmi:CreateShape soapenv:encodingStyle="<http://schemas.xmlsoap.org/soap/encoding/>" xmlns:oldthing="<http://www.wwwdotcom.com/schema/docco/v2/gone>">
            <jobType>
                <description>Shape 123</description>
                <name>SHAPE_TYPE_NAME</name>
                <rDryer>0</rDryer>
                <machine>18</machine>
            </jobType>
        </sdmi:CreateShape>
    </soapenv:Body>
</soapenv:Envelope>
j
With Serialization I usually go the other way. I try to create a data class and serialize it to String and mutate it until it matches my expected output. Once that is done the data class can “also” be used to deserialize the input.
👀 1
1