public Map<String, String> convertFaultObjectToMap(HttpResponseBean soapResp) { DocumentImpl doc = (DocumentImpl) soapResp.getResponseObject(); String actualFaultCode = doc.getElementsByTagName("faultcode").item(0).getFirstChild().getNodeValue(); String actualFaultString = doc.getElementsByTagName("faultstring").item(0).getFirstChild().getNodeValue(); String actualMessage = doc.getElementsByTagName("message").item(0).getFirstChild().getNodeValue(); Node actualTraceNode = doc.getElementsByTagName("trace").item(0).getFirstChild(); String actualTrace = ""; if (actualTraceNode != null) { actualTrace = actualTraceNode.getNodeValue(); actualTrace = actualTrace.replace( "\r", ""); // Clean string of escaped characters (to avoid errors on Linux CI build) actualTrace = actualTrace.trim(); } Map<String, String> responseMap = new HashMap<String, String>(); responseMap.put("faultCode", actualFaultCode); responseMap.put("faultString", actualFaultString); responseMap.put("faultMessage", actualMessage); responseMap.put("faultTrace", actualTrace); return responseMap; }
/** * Reads the document. * * @param p0 the category * @param p1 the document */ static void read_document(java.lang.Object p0, java.lang.Object p1) throws java.lang.Exception { org.apache.xerces.dom.DocumentImpl doc = (org.apache.xerces.dom.DocumentImpl) p1; if (doc != null) { LogHandler.log(LogHandler.INFO_LOG_LEVEL, "Read document."); doc.normalize(); org.apache.xerces.dom.DeepNodeListImpl l = null; if (p0 != null) { l = (org.apache.xerces.dom.DeepNodeListImpl) doc.getElementsByTagName(CategoryHandler.SUPER_CATEGORY); CategoryHandler.initialize_super_category(p0, l); l = (org.apache.xerces.dom.DeepNodeListImpl) doc.getElementsByTagName(CategoryHandler.JAVA_OBJECT); CategoryHandler.initialize_java_objects(p0, l); l = (org.apache.xerces.dom.DeepNodeListImpl) doc.getElementsByTagName(CategoryHandler.ITEM); CategoryHandler.initialize_items(((Item) p0).items, l); } else { LogHandler.log( LogHandler.ERROR_LOG_LEVEL, "Could not read document. The category is null."); } } else { LogHandler.log(LogHandler.ERROR_LOG_LEVEL, "Could not read document. The document is null."); } }