Search in sources :

Example 46 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class CoordinatorCompletionCoordinatorEngine method sendInvalidStateFault.

/**
 * Send the invalid state fault message.
 */
private void sendInvalidStateFault() {
    final MAP map = createContext();
    try {
        final SoapFault11 soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_engines_CoordinatorCompletionCoordinatorEngine_sendInvalidStateFault_2());
        CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, participant, map, getFaultAction());
    } catch (final Throwable th) {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("Unexpected exception while sending InvalidStateFault", th);
        }
    }
}
Also used : SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP)

Example 47 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class CoordinatorCompletionParticipantClient method sendSoapFault.

/**
 * send a soap fault
 * @param soapFault the fault to be sent
 * @param endpoint the endpoint to send the fault to
 * @param map addressing context to be used to send the fault
 * @param faultAction the action to associate with the message
 */
public void sendSoapFault(SoapFault11 soapFault, W3CEndpointReference endpoint, MAP map, String faultAction) throws SoapFault, IOException {
    AddressingHelper.installNoneReplyTo(map);
    map.setAction(faultAction);
    BusinessAgreementWithCoordinatorCompletionParticipantPortType port;
    port = getPort(endpoint, map, faultAction);
    Fault fault = ((SoapFault11) soapFault).toFault();
    port.soapFault(fault);
}
Also used : BusinessAgreementWithCoordinatorCompletionParticipantPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionParticipantPortType) SoapFault(com.arjuna.webservices.SoapFault) Fault(org.xmlsoap.schemas.soap.envelope.Fault) SoapFault11(com.arjuna.webservices11.SoapFault11)

Example 48 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class ParticipantCompletionParticipantClient method sendSoapFault.

/**
 * send a soap fault
 * @param soapFault the fault to be sent
 * @param endpoint the endpoint to send the fault to
 * @param map addressing context to be used to send the fault
 * @param faultAction the action to associate with the message
 */
public void sendSoapFault(SoapFault11 soapFault, W3CEndpointReference endpoint, MAP map, String faultAction) throws SoapFault, IOException {
    AddressingHelper.installNoneReplyTo(map);
    map.setAction(faultAction);
    BusinessAgreementWithParticipantCompletionParticipantPortType port;
    port = getPort(endpoint, map, faultAction);
    Fault fault = ((SoapFault11) soapFault).toFault();
    port.soapFault(fault);
}
Also used : SoapFault(com.arjuna.webservices.SoapFault) Fault(org.xmlsoap.schemas.soap.envelope.Fault) SoapFault11(com.arjuna.webservices11.SoapFault11) BusinessAgreementWithParticipantCompletionParticipantPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithParticipantCompletionParticipantPortType)

Example 49 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionParticipantPortTypeImpl method soapFault.

@WebMethod(operationName = "fault", action = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/fault")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wscoor/2006/06/fault")
public void soapFault(@WebParam(name = "Fault", targetNamespace = "http://schemas.xmlsoap.org/soap/envelope/", partName = "parameters") Fault fault) {
    MessageContext ctx = webServiceCtx.getMessageContext();
    final MAP inboundMap = AddressingHelper.inboundMap(ctx);
    final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);
    final SoapFault soapFault = SoapFault11.fromFault(fault);
    TaskManager.getManager().queueTask(new Task() {

        public void executeTask() {
            CoordinatorCompletionParticipantProcessor.getProcessor().soapFault(soapFault, inboundMap, arjunaContext);
            ;
        }
    });
}
Also used : SoapFault(com.arjuna.webservices.SoapFault) 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 50 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class ParticipantCompletionCoordinatorProcessorImpl method getStatus.

/**
 * Get Status.
 * @param getStatus The get status notification.
 * @param map The addressing context.
 * @param arjunaContext The arjuna context.
 */
public void getStatus(final NotificationType getStatus, final MAP map, final ArjunaContext arjunaContext) {
    final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
    final ParticipantCompletionCoordinatorInboundEvents coordinator = getCoordinator(instanceIdentifier);
    if (coordinator != null) {
        try {
            coordinator.getStatus(getStatus, map, arjunaContext);
        } catch (final Throwable th) {
            if (WSTLogger.logger.isTraceEnabled()) {
                WSTLogger.logger.tracev("Unexpected exception thrown from getStatus:", th);
            }
        }
    } else if (!areRecoveryLogEntriesAccountedFor()) {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("GetStatus dropped for unknown coordinator completion participant {0} while waiting on recovery scan", new Object[] { instanceIdentifier });
        }
    } else {
        if (WSTLogger.logger.isTraceEnabled()) {
            WSTLogger.logger.tracev("GetStatus called on unknown coordinator: {0}", new Object[] { instanceIdentifier });
        }
        // send an invalid state fault
        final String messageId = MessageId.getMessageId();
        final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
        try {
            final SoapFault11 soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_ParticipantCompletionCoordinatorProcessorImpl_getStatus_4());
            AddressingHelper.installNoneReplyTo(faultMAP);
            ParticipantCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, faultMAP, getFaultAction());
        } catch (final Throwable th) {
            WSTLogger.i18NLogger.info_wst11_messaging_ParticipantCompletionCoordinatorProcessorImpl_getStatus_3(instanceIdentifier.toString(), th);
        }
    }
}
Also used : ParticipantCompletionCoordinatorInboundEvents(com.arjuna.webservices11.wsba.ParticipantCompletionCoordinatorInboundEvents) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

SoapFault11 (com.arjuna.webservices11.SoapFault11)104 MAP (org.jboss.ws.api.addressing.MAP)74 MessageContext (javax.xml.ws.handler.MessageContext)54 Action (javax.xml.ws.Action)51 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)42 RequestWrapper (javax.xml.ws.RequestWrapper)38 SoapFault (com.arjuna.webservices.SoapFault)28 Uid (com.arjuna.ats.arjuna.common.Uid)22 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)18 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)10 Fault (org.xmlsoap.schemas.soap.envelope.Fault)10 Task (com.arjuna.services.framework.task.Task)9 QName (javax.xml.namespace.QName)8 SoapFaultType (com.arjuna.webservices.SoapFaultType)7 Test (org.junit.Test)7 ParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantEngine)6 SOAPBinding (javax.jws.soap.SOAPBinding)6 SystemException (com.arjuna.wst.SystemException)5 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)5 ParticipantCompletionParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine)5