Search in sources :

Example 11 with ExceptionType

use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project ddf by codice.

the class CswExceptionMapper method createServiceException.

private ExceptionReport createServiceException(CswException cswException) {
    ExceptionReport exceptionReport = new ExceptionReport();
    exceptionReport.setVersion(SERVICE_EXCEPTION_REPORT_VERSION);
    ExceptionType exception = new ExceptionType();
    exception.setExceptionCode(cswException.getExceptionCode());
    exception.setLocator(cswException.getLocator());
    exception.getExceptionText().add(cswException.getMessage());
    exceptionReport.getException().add(exception);
    return exceptionReport;
}
Also used : ExceptionType(net.opengis.ows.v_1_0_0.ExceptionType) ExceptionReport(net.opengis.ows.v_1_0_0.ExceptionReport)

Example 12 with ExceptionType

use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project ddf by codice.

the class WfsResponseExceptionMapper method convertToWfsException.

private WfsException convertToWfsException(ExceptionReport report) {
    WfsException wfsException = null;
    List<ExceptionType> list = report.getException();
    if (!list.isEmpty()) {
        Collections.reverse(list);
        for (ExceptionType exceptionType : list) {
            String exceptionCode = exceptionType.getExceptionCode();
            String locator = exceptionType.getLocator();
            List<String> exceptionText = exceptionType.getExceptionText();
            StringBuilder exceptionMsg = new StringBuilder();
            // Exception code is required per CSW schema, but check it anyway
            if (StringUtils.isNotBlank(exceptionCode)) {
                exceptionMsg.append("exceptionCode = " + exceptionCode + "\n");
            } else {
                exceptionMsg.append("exceptionCode = UNSPECIFIED");
            }
            // Locator and exception text(s) are both optional
            if (StringUtils.isNotBlank(locator)) {
                exceptionMsg.append("locator = " + locator + "\n");
            }
            if (!CollectionUtils.isEmpty(exceptionText)) {
                for (String text : exceptionText) {
                    exceptionMsg.append(text);
                }
            }
            wfsException = new WfsException(exceptionMsg.toString());
        }
        if (null == wfsException) {
            wfsException = new WfsException("Empty Service Exception Report (version = " + report.getVersion() + ")");
        }
    } else {
        wfsException = new WfsException("Empty Service Exception Report (version = " + report.getVersion() + ")");
    }
    return wfsException;
}
Also used : ExceptionType(net.opengis.ows.v_1_1_0.ExceptionType) WfsException(org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException)

Example 13 with ExceptionType

use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.

the class LibraryServerImpl method prepareException.

private SeekBookError prepareException(String message) {
    ExceptionType exception = new ExceptionType();
    exception.setOperation("seekBook");
    exception.setServiceName("LibraryService");
    exception.setExceptionText(message);
    ExceptionFrame frame = new ExceptionFrame();
    frame.getException().add(exception);
    return new SeekBookError("Book not found", frame);
}
Also used : ExceptionType(org.talend.types.test.generalobjects.errorhandling._1.ExceptionType) SeekBookError(org.talend.services.test.library._1_0.SeekBookError) ExceptionFrame(org.talend.types.test.generalobjects.errorhandling._1.ExceptionFrame)

Example 14 with ExceptionType

use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.

the class LibraryServerImpl method prepareException.

private SeekBookError prepareException(String message) {
    ExceptionType exception = new ExceptionType();
    exception.setOperation("seekBook");
    exception.setServiceName("LibraryService");
    exception.setExceptionText(message);
    ExceptionFrame frame = new ExceptionFrame();
    frame.getException().add(exception);
    return new SeekBookError("Book not found", frame);
}
Also used : ExceptionType(org.talend.types.test.generalobjects.errorhandling._1.ExceptionType) SeekBookError(org.talend.services.test.library._1_0.SeekBookError) ExceptionFrame(org.talend.types.test.generalobjects.errorhandling._1.ExceptionFrame)

Example 15 with ExceptionType

use of org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType in project tesb-rt-se by Talend.

the class LibraryServerImpl method prepareException.

private SeekBookError prepareException(String message) {
    ExceptionType exception = new ExceptionType();
    exception.setOperation("seekBook");
    exception.setServiceName("LibraryService");
    exception.setExceptionText(message);
    ExceptionFrame frame = new ExceptionFrame();
    frame.getException().add(exception);
    return new SeekBookError("Book not found", frame);
}
Also used : ExceptionType(org.talend.types.test.generalobjects.errorhandling._1.ExceptionType) SeekBookError(org.talend.services.test.library._1_0.SeekBookError) ExceptionFrame(org.talend.types.test.generalobjects.errorhandling._1.ExceptionFrame)

Aggregations

SeekBookError (org.talend.services.test.library._1_0.SeekBookError)5 ExceptionFrame (org.talend.types.test.generalobjects.errorhandling._1.ExceptionFrame)5 ExceptionType (org.talend.types.test.generalobjects.errorhandling._1.ExceptionType)5 ExceptionType (org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType)4 ExceptionType (net.opengis.ows.v_1_0_0.ExceptionType)3 ExceptionType (net.opengis.ows.x11.ExceptionType)3 Task (com.arjuna.services.framework.task.Task)2 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)2 ArrayList (java.util.ArrayList)2 Action (javax.xml.ws.Action)2 MessageContext (javax.xml.ws.handler.MessageContext)2 WfsException (org.codice.ddf.spatial.ogc.wfs.catalog.common.WfsException)2 MAP (org.jboss.ws.api.addressing.MAP)2 MAPEndpoint (org.jboss.ws.api.addressing.MAPEndpoint)2 SuppressFBWarnings (edu.umd.cs.findbugs.annotations.SuppressFBWarnings)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 ExceptionReport (net.opengis.ows.v_1_0_0.ExceptionReport)1 ExceptionType (net.opengis.ows.v_1_1_0.ExceptionType)1 ExceptionDocument (net.opengis.ows.x11.ExceptionDocument)1