Search in sources :

Example 51 with SoapFault11

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

the class ParticipantPortTypeImpl method soapFault.

@WebMethod(operationName = "SoapFault", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/fault")
@Oneway
@Action(input = "http://docs.oasis-open.org/ws-tx/wsat/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() {
            ParticipantProcessor.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 52 with SoapFault11

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

the class CoordinatorCompletionCoordinatorClient 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);
    BusinessAgreementWithCoordinatorCompletionCoordinatorPortType port;
    port = getPort(endpoint, map, faultAction);
    Fault fault = ((SoapFault11) soapFault).toFault();
    port.soapFault(fault);
}
Also used : BusinessAgreementWithCoordinatorCompletionCoordinatorPortType(org.oasis_open.docs.ws_tx.wsba._2006._06.BusinessAgreementWithCoordinatorCompletionCoordinatorPortType) SoapFault(com.arjuna.webservices.SoapFault) Fault(org.xmlsoap.schemas.soap.envelope.Fault) SoapFault11(com.arjuna.webservices11.SoapFault11)

Example 53 with SoapFault11

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

the class CoordinatorEngine method sendUnknownTransaction.

/**
 * Send the UnknownTransaction message.
 */
private void sendUnknownTransaction(final MAP map, final ArjunaContext arjunaContext) {
    try {
        final MAP faultMAP = AddressingHelper.createFaultContext(map, MessageId.getMessageId());
        final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
        final String message = WSTLogger.i18NLogger.get_wst11_messaging_engines_CoordinatorEngine_sendUnknownTransaction_1();
        final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, AtomicTransactionConstants.WSAT_ERROR_CODE_UNKNOWN_TRANSACTION_QNAME, message);
        ParticipantClient.getClient().sendSoapFault(faultMAP, soapFault, instanceIdentifier);
    } catch (final Throwable th) {
        WSTLogger.i18NLogger.warn_wst11_messaging_engines_CoordinatorEngine_sendUnknownTransaction_2(id, th);
    }
}
Also used : SoapFault(com.arjuna.webservices.SoapFault) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP)

Example 54 with SoapFault11

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

the class BAParticipantProcessor method cannotComplete.

/**
 * Execute the CannotComplete
 * @param map The current addressing context.
 *
 * @throws SoapFault11 for errors during processing
 */
public void cannotComplete(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault11 {
    try {
        final CannotCompleteParticipant participant = new CannotCompleteParticipant();
        final CoordinatorCompletionParticipantEngine engine = BAInteropUtil.registerCoordinatorCompletion(coordinationContext, participant, new Uid().toString());
        participant.setEngine(engine);
        participant.initialiseTimeout();
    } catch (final Throwable th) {
        throw new SoapFault11(th);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) CannotCompleteParticipant(com.jboss.transaction.txinterop.webservices.bainterop.participant.CannotCompleteParticipant) CoordinatorCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.CoordinatorCompletionParticipantEngine) SoapFault11(com.arjuna.webservices11.SoapFault11)

Example 55 with SoapFault11

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

the class BAParticipantProcessor method participantCancelCompletedRace.

/**
 * Execute the ParticipantCancelCompletedRace
 * @param map The current addressing context.
 *
 * @throws SoapFault11 for errors during processing
 */
public void participantCancelCompletedRace(final CoordinationContextType coordinationContext, final MAP map) throws SoapFault11 {
    try {
        final CompletedParticipant participant = new CompletedParticipant();
        final ParticipantCompletionParticipantEngine engine = BAInteropUtil.registerParticipantCompletion(coordinationContext, participant, new Uid().toString());
        participant.setEngine(engine);
        participant.initialiseTimeout();
    } catch (final Throwable th) {
        throw new SoapFault11(th);
    }
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantCompletionParticipantEngine(com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine) CompletedParticipant(com.jboss.transaction.txinterop.webservices.bainterop.participant.CompletedParticipant) SoapFault11(com.arjuna.webservices11.SoapFault11)

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