private ExceptionReport parseExceptionReport_100(OperationResult result) throws XmlException { String requestResult = new String(result.getIncomingResult()); ExceptionReportDocument exceptionReportDocument = ExceptionReportDocument.Factory.parse(requestResult); String language = exceptionReportDocument.getExceptionReport().getLang(); String version = exceptionReportDocument.getExceptionReport().getVersion(); ExceptionReport exceptionReport = new ExceptionReport(version, language); ExceptionType[] exceptions = exceptionReportDocument.getExceptionReport().getExceptionArray(); for (ExceptionType exceptionType : exceptions) { String exceptionCode = exceptionType.getExceptionCode(); String[] exceptionMessages = exceptionType.getExceptionTextArray(); if ("ResponseExceedsSizeLimit".equalsIgnoreCase(exceptionCode)) { String errorMsg = Arrays.toString(exceptionMessages); errorMsg = errorMsg.replace("[", "").replace("]", ""); throw new ResponseExceedsSizeLimitException(errorMsg); } String locator = exceptionType.getLocator(); String sentRequest = result.getSendedRequest(); OWSException owsException = new OWSException(exceptionMessages, exceptionCode, sentRequest, locator); exceptionReport.addException(owsException); } return exceptionReport; }
private ExceptionReport parseOws110ExceptionReport(final OperationResult result) throws IOException, XmlException { final ExceptionReportDocument xb_execRepDoc = ExceptionReportDocument.Factory.parse(result.getIncomingResultAsAutoCloseStream()); final net.opengis.ows.x11.ExceptionType[] xb_exceptions = xb_execRepDoc.getExceptionReport().getExceptionArray(); final String language = xb_execRepDoc.getExceptionReport().getLang(); final String version = xb_execRepDoc.getExceptionReport().getVersion(); final ExceptionReport oxf_execReport = new ExceptionReport(version, language); for (final ExceptionType xb_exec : xb_exceptions) { final String execCode = xb_exec.getExceptionCode(); final String[] execMsgs = xb_exec.getExceptionTextArray(); final String locator = xb_exec.getLocator(); final OWSException owsExec = new OWSException(execMsgs, execCode, result.getSendedRequest(), locator); oxf_execReport.addException(owsExec); } return oxf_execReport; }