我正在使用retrofit
和SimpleXMLConverterFactory
。參數不匹配; SimpleXML
,我總是得到一個
ConstructorException: Parameter 'success' does not have a match in class ResponseInfo
而且我不知道什麼可能是錯誤的。 xml非常簡單,我只需要success
節點中的字符串。
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)
編輯1:我測試的API調用,並返回給定XML。
感謝