public boolean is_error() throws XdsInternalException { String status = get_registry_response_status(); return ! status.endsWith("Success"); }
protected boolean scanResponseForErrors() throws XdsInternalException { if (s_ctx.getExpectedStatus().size()==1 && s_ctx.getExpectedStatus().get(0).isSuccess()) { RegistryResponseParser registry_response = new RegistryResponseParser(getSoapResult()); List<String> errs = registry_response.get_regrep_error_msgs(); if (errs.size() > 0) { logger.info("Received errors in response"); for (String err : errs) s_ctx.set_error(err); failed(); return false; } } return true; }
public ArrayList<String> get_error_code_contexts() { ArrayList<String> result = new ArrayList<String>(); OMElement registry_error_list = null; if (response_element.getLocalName().equals("RegistryErrorList")) registry_error_list = response_element; else registry_error_list = XmlUtil.firstChildWithLocalName(response_element, "RegistryErrorList") ; if (registry_error_list == null) return result; for (OMElement registry_error : XmlUtil.childrenWithLocalName(registry_error_list, "RegistryError")) { String severity = get_att(registry_error, "severity"); if (severity == null || !severity.endsWith("Error")) continue; String code_context = get_att(registry_error, "codeContext"); if (code_context != null) result.add(code_context); String error_code = get_att(registry_error, "errorCode"); if (error_code != null) result.add(error_code); } return result; }
private void loadStepContextwithResponseErrors(String responseString) throws XdsInternalException, JaxenException { OMElement envelopeEle = Util.parse_xml(responseString); AXIOMXPath xpathExpression = new AXIOMXPath ("//*[local-name()='RegistryResponse']"); List nodeList = xpathExpression.selectNodes(envelopeEle); if (nodeList.size() != 1) { s_ctx.set_error("Cannot extract RegistryResponse from SOAP Message"); failed(); return; } OMElement responseEle = (OMElement) nodeList.get(0); RegistryResponseParser responseParser = new RegistryResponseParser(responseEle); if(responseParser.is_error()) { s_ctx.set_error(responseParser.get_regrep_error_msgs()); failed(); } }
String status = r_ctx.getRrp().get_registry_response_status(); eval_expected_status(status, r_ctx.getRrp().get_error_code_contexts()); List <String> errCodesReturned = r_ctx.getRrp().get_error_codes(); if (!errCodesReturned.contains(expErrorCode)) { s_ctx.set_error("Expected errorCode of " + expErrorCode + "\nDid getRetrievedDocumentsModel errorCodes of "
RegistryResponseParser registry_response = new RegistryResponseParser(registry_result); String status = registry_response.get_registry_response_status(); ArrayList<String> returned_code_contexts = registry_response.get_error_code_contexts(); ArrayList<String> validatorErrors = new RegistryResponseParser(rel.getRegistryErrorList()).get_error_code_contexts(); returned_code_contexts.addAll(validatorErrors); List<String> errorCodes = registry_response.get_error_codes(); if ( ! errorCodes.contains(expectedErrorCode)) { s_ctx.set_error("Expected errorCode of " + expectedErrorCode + "\nDid getRetrievedDocumentsModel errorCodes of " +
RegistryResponseParser rrp = new RegistryResponseParser(m.getMetadata()); if (MetadataSupport.status_failure.equals(rrp.get_registry_response_status())) { err("Response status is Failure."); return false;
RegistryResponseParser rrp = new RegistryResponseParser(registry_response); r_ctx.setRrp(rrp); String errors = rrp.get_regrep_error_msg();
public String get_regrep_error_msg() { List<String> msgs = get_regrep_error_msgs(); StringBuilder buf = new StringBuilder(); for (String x : msgs) buf.append(x); return buf.toString(); }
void parse() throws XdsInternalException { response = new RegistryResponse(); response.success = is_error(); response.topElement = response_element; OMElement registry_error_list = null; if (response_element.getLocalName().equals("RegistryErrorList")) registry_error_list = response_element; else registry_error_list = XmlUtil.firstChildWithLocalName(response_element, "RegistryErrorList") ; if (registry_error_list == null) return; response.registryErrorList = new RegistryErrorListParser(registry_error_list).getRegistryErrorList(); }
public RegistryResponse getRegistryResponse() throws XdsInternalException { parse(); return response; }
public List<String> get_regrep_error_msgs() { List<String> messages = new ArrayList<>(); if (response_element == null) return asList("No Message"); OMElement registry_response = XmlUtil.firstChildWithLocalName(response_element, "RegistryResponse") ; OMElement current = (registry_response == null) ? response_element : registry_response; OMElement registry_error_list = XmlUtil.firstChildWithLocalName(current, "RegistryErrorList") ; if (registry_error_list == null) return messages; for (OMElement registry_error : XmlUtil.childrenWithLocalName(registry_error_list, "RegistryError")) { String severity = registry_error.getAttributeValue(MetadataSupport.severity_qname); if (severity != null && severity.endsWith("Warning")) continue; String msg = registry_error.getAttributeValue(new QName("errorCode")) + " : " + registry_error.getAttributeValue(new QName("codeContext")) + " : " + registry_error.getText(); if (msg == null) continue; messages.add(msg); } return messages; }
RegistryResponseParser registry_response = new RegistryResponseParser(result); if ( registry_response.is_error()) fail(registry_response.get_regrep_error_msgs());
String status = r_ctx.getRrp().get_registry_response_status(); eval_expected_status(status, r_ctx.getRrp().get_error_code_contexts()); List<String> errCodesReturned = r_ctx.getRrp().get_error_codes(); if (!errCodesReturned.contains(expErrorCode)) { s_ctx.set_error("Expected errorCode of " + expErrorCode + "\nDid getRetrievedDocumentsModel errorCodes of " +
RegistryResponseParser rrp = new RegistryResponseParser(registry_response); r_ctx.setRrp(rrp); String errors = rrp.get_regrep_error_msg();
public ArrayList<String> get_error_codes() { ArrayList<String> result = new ArrayList<String>(); OMElement registry_error_list = null; if (response_element.getLocalName().equals("RegistryErrorList")) registry_error_list = response_element; else registry_error_list = XmlUtil.firstChildWithLocalName(response_element, "RegistryErrorList") ; if (registry_error_list == null) return result; for (OMElement registry_error : XmlUtil.childrenWithLocalName(registry_error_list, "RegistryError")) { String errorCode = get_att(registry_error, "errorCode"); if (errorCode == null) continue; if (errorCode != null) result.add(errorCode); } return result; }