I am using retrofit
with the SimpleXMLConverterFactory
.
And I always get an
ConstructorException: Parameter 'success' does not have a match in class ResponseInfo
And I have no idea what could be wrong. The xml is very simple and i only want the string from the success
node.
xml:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<success>LoremIpsum</success>
</response>
ResponseInfo:
@Root(strict = false, name = "response")
data class ResponseInfo(@Element(required = false, name = "success) var success: String)
Edit 1: I tested the Api call and it returns the given xml.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…