Search in sources :

Example 1 with ServiceExceptionType

use of ogc.schema.opengis.wfs.exception.v_1_0_0.ServiceExceptionType in project ddf by codice.

the class WfsResponseExceptionMapper method convertToWfsException.

private WfsException convertToWfsException(ServiceExceptionReport report) {
    WfsException wfsException = null;
    List<ServiceExceptionType> list = new ArrayList<ServiceExceptionType>(report.getServiceException());
    if (list.size() > 0) {
        Collections.reverse(list);
        StringBuilder exceptionMsg = new StringBuilder();
        for (ServiceExceptionType serviceException : list) {
            exceptionMsg.append(serviceException.getValue());
        }
        wfsException = new WfsException(exceptionMsg.toString());
    }
    if (null == wfsException) {
        wfsException = new WfsException("Empty Service Exception Report (version = " + report.getVersion() + ")");
    }
    return wfsException;
}
Also used : WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException) ArrayList(java.util.ArrayList) ServiceExceptionType(ogc.schema.opengis.wfs.exception.v_1_0_0.ServiceExceptionType)

Aggregations

ArrayList (java.util.ArrayList)1 ServiceExceptionType (ogc.schema.opengis.wfs.exception.v_1_0_0.ServiceExceptionType)1 WfsException (org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException)1