I need to convert this XML:
<?xml version="1.0" encoding="utf-8"?>
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Status>0</Status>
<Credit>98</Credit>
</Response>
to a Java HashMap using XStream:
XStream xStream = new XStream();
xStream.alias("hashmap", java.util.HashMap.class);
HashMap<String, Object> myHashmap = (HashMap<String, Object>) xStream.fromXML(myXmlAsString);
but this exception is thrown:
com.thoughtworks.xstream.mapper.CannotResolveClassException: Response
My question is: what am I doing wroing? I've browsed similar threads here but none seem to help. Any advice appreciated