I'm getting a null document object but not sure why - it's not really clear from the debugger.
public Document parseResponse(String respBody) throws ParserConfigurationException, IOException, SAXException {
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
InputSource source = new InputSource();
source.setCharacterStream(new StringReader(respBody));
Document doc = builder.parse(source);
return doc;
}
Can you please post your respBody
String here. Is it a well-formed XML without unnecessary special characters like \\n. Please note - Windows usually end lines with CR+LF; MacOS X and Linux, LF; classic Mac OS, CR.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.