parseResponse method
Response Message Format: success = "true" | "false"; status = if error return "error code", else return '0';
[xmlStr] [isGetInfo] if exceImplementation
Response parseResponse(String xmlStr, [bool isGetInfo = false]) {
// create xml parser
final parser = Xml2Json();
// parse to object
parser.parse(xmlStr);
final jsonStr = parser.toParkerWithAttrs();
final xmlObj = jsonDecode(jsonStr);
Map? response;
if (xmlObj != null && xmlObj.isNotEmpty) {
// get response data
response = xmlObj[isGetInfo
? CustomXmlHttpClient._infoXmlResponse
: CustomXmlHttpClient._xmlResponse];
}
return Response(
ok: response != null && response['_success'] == 'true',
body: response,
);
}