Search in sources :

Example 6 with ExceptionType

use of org.talend.types.test.generalobjects.errorhandling._1.ExceptionType in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionCoordinatorPortTypeImpl method failOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
public void failOperation(@WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters") ExceptionType parameters) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final ExceptionType fail = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorCompletionCoordinatorProcessor.getProcessor().fail(fail, inboundMap, arjunaContext);
        }
    });
}
Also used : ExceptionType(org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType) Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Action(javax.xml.ws.Action)

Example 7 with ExceptionType

use of org.talend.types.test.generalobjects.errorhandling._1.ExceptionType in project narayana by jbosstm.

the class CoordinatorCompletionCoordinatorClient method sendFail.

/**
 *                                                                 Address
 * Send a fail request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendFail(W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier, final QName exceptionIdentifier) throws SoapFault, IOException {
    MAPEndpoint participant = getParticipant(endpoint, map);
    AddressingHelper.installFromFaultTo(map, participant, identifier);
    BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
    port = getPort(endpoint, map, failAction);
    ExceptionType fail = new ExceptionType();
    fail.setExceptionIdentifier(exceptionIdentifier);
    port.failOperation(fail);
}
Also used : ExceptionType(org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType) MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) BusinessAgreementWithCoordinatorCompletionCoordinatorPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorPortType)

Example 8 with ExceptionType

use of org.talend.types.test.generalobjects.errorhandling._1.ExceptionType in project narayana by jbosstm.

the class ParticipantCompletionCoordinatorClient method sendFail.

/**
 * Send a fault request.
 * @param map addressing context initialised with to and message ID.
 * @param identifier The identifier of the initiator.
 * @throws com.arjuna.webservices.SoapFault For any errors.
 * @throws java.io.IOException for any transport errors.
 */
public void sendFail(W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier, final QName exceptionIdentifier) throws SoapFault, IOException {
    if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.trace(getClass().getSimpleName() + ".sendFail");
    }
    MAPEndpoint participant = getParticipant(endpoint, map);
    AddressingHelper.installFromFaultTo(map, participant, identifier);
    BusinessAgreementWithParticipantCompletionCoordinatorPortType port;
    port = getPort(endpoint, map, failAction);
    ExceptionType fail = new ExceptionType();
    fail.setExceptionIdentifier(exceptionIdentifier);
    port.failOperation(fail);
}
Also used : ExceptionType(org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType) MAPEndpoint(org.jboss.ws.api.addressing.MAPEndpoint) BusinessAgreementWithParticipantCompletionCoordinatorPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionCoordinatorPortType)

Example 9 with ExceptionType

use of org.talend.types.test.generalobjects.errorhandling._1.ExceptionType in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorPortTypeImpl method failOperation.

/**
 * @param parameters
 */
@WebMethod(operationName = "FailOperation", action = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsba/2006/06/Fail")
public void failOperation(@WebParam(name = "Fail", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsba/2006/06", partName = "parameters") ExceptionType parameters) {
    if (WSTLogger.logger.isTraceEnabled()) {
        WSTLogger.logger.trace(getClass().getSimpleName() + ".failOperation");
    }
    MessageContext ctx = webServiceCtx.getMessageContext();
    final ExceptionType fail = parameters;
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            ParticipantCompletionCoordinatorProcessor.getProcessor().fail(fail, inboundMap, arjunaContext);
        }
    });
}
Also used : ExceptionType(org.oasis_open.docs.ws_tx.wsba._2006._06.ExceptionType) Task(com.arjuna.services.framework.task.Task) MessageContext(javax.xml.ws.handler.MessageContext) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Action(javax.xml.ws.Action)

Example 10 with ExceptionType

use of org.talend.types.test.generalobjects.errorhandling._1.ExceptionType in project ddf by codice.

the class WfsResponseExceptionMapper method convertToWfsException.

private WfsException convertToWfsException(ExceptionReport report) {
    WfsException wfsException = null;
    List<ExceptionType> list = new ArrayList<ExceptionType>(report.getException());
    if (list.size() > 0) {
        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) ArrayList(java.util.ArrayList)

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 ArrayList (java.util.ArrayList)3 ExceptionType (net.opengis.ows.x11.ExceptionType)3 Task (com.arjuna.services.framework.task.Task)2 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)2 Action (javax.xml.ws.Action)2 MessageContext (javax.xml.ws.handler.MessageContext)2 ExceptionType (net.opengis.ows.v_1_0_0.ExceptionType)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 ExceptionReportDocument (net.opengis.ows.x11.ExceptionReportDocument)1