ktor just handles http/networking and soap is just xml request/response, so yes but you'd need to create the request/response manually
p
PHondogo
09/24/2019, 7:14 PM
Thanks! Is there any plugin for ktor to convert xml to pojo?
j
Jeremy
09/24/2019, 7:57 PM
Is your target a mobile app?
Jeremy
09/24/2019, 7:58 PM
soap xml tends to be very verbose and parsing it can be memory intensive, you might want to look into a sax parser
Jeremy
09/24/2019, 7:59 PM
You could possibly utilize kotlinx serialization if you created your own mapper
Jeremy
09/24/2019, 8:01 PM
I think given the choice though you might want to investigate alternatives, if you can't control the server maybe putting a proxy in front of it
g
gildor
09/25/2019, 2:25 AM
plugin for ktor to convert xml to pojo
You can use Jackson and XmlMapper. And create ContentNegatiation feature for Ktor (not sure that there is one available for XML, you can check how Jackson ContentNegatiation feature is implemented for Json
https://github.com/ktorio/ktor/blob/master/ktor-features/ktor-jackson/jvm/src/io/ktor/jackson/JacksonConverter.kt
Also probably make sense to create a fetaure request to provide ktor-jackson-xml dependency, but it’s quite trivial to implement yourself