use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class SoapFault11 method create.
public static SoapFault11 create(SOAPFaultException sfe) {
try {
SOAPFault cause = sfe.getFault();
QName faultCode = cause.getFaultCodeAsQName();
String reason = cause.getFaultString();
SoapFaultType soapFaultType = SoapFaultType.toState(reason);
Detail detail = cause.getDetail();
return new SoapFault11(soapFaultType, faultCode, null, detail);
} catch (InvalidEnumerationException e) {
return new SoapFault11(e);
}
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class ParticipantEngine method soapFault.
/**
* Handle the soap fault event.
* @param soapFault The soap fault.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext) {
if (WSTLogger.logger.isTraceEnabled()) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final SoapFaultType soapFaultType = soapFault.getSoapFaultType();
final QName subCode = soapFault.getSubcode();
WSTLogger.logger.tracev("Unexpected SOAP fault for participant {0}: {1} {2}", new Object[] { instanceIdentifier, soapFaultType, subCode });
}
QName subcode = soapFault.getSubcode();
if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode) || AtomicTransactionConstants.WSAT_ERROR_CODE_INCONSISTENT_INTERNAL_STATE_QNAME.equals(subcode) || AtomicTransactionConstants.WSAT_ERROR_CODE_UNKNOWN_TRANSACTION_QNAME.equals(subcode)) {
final SoapFaultType soapFaultType = soapFault.getSoapFaultType();
final QName subCode = soapFault.getSubcode();
WSTLogger.i18NLogger.error_wst11_messaging_engines_ParticipantEngine_soapFault_2(id, soapFaultType.toString(), subCode);
// unrecoverable error -- forget this participant and delete any persistent
// record of it
final State current;
synchronized (this) {
current = state;
state = null;
}
if (current == State.STATE_PREPARED_SUCCESS && AtomicTransactionConstants.WSAT_ERROR_CODE_UNKNOWN_TRANSACTION_QNAME.equals(subcode)) {
// we need to tell this participant to roll back
executeRollback();
}
if (persisted && participant instanceof Durable2PCParticipant) {
// remove any durable participant recovery record from the persistent store
Durable2PCParticipant durableParticipant = (Durable2PCParticipant) participant;
// if we cannot delete the participant we record an error here
if (!XTSATRecoveryManager.getRecoveryManager().deleteParticipantRecoveryRecord(id)) {
// hmm, could not delete entry -- log an error
WSTLogger.i18NLogger.error_wst11_messaging_engines_ParticipantEngine_soapFault_3(id);
}
}
forget();
}
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class CoordinatorEngine method soapFault.
/**
* Handle the soap fault event.
* @param soapFault The soap fault.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext) {
if (WSTLogger.logger.isTraceEnabled()) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final SoapFaultType soapFaultType = soapFault.getSoapFaultType();
final QName subCode = soapFault.getSubcode();
WSTLogger.logger.tracev("Unexpected SOAP fault for coordinator {0}: {1} {2}", new Object[] { instanceIdentifier, soapFaultType, subCode });
}
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6");
final String reason = "testSendErrorReason";
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason);
ParticipantCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode());
assertEquals(details.hasSoapFault().getReason(), soapFault.getReason());
checkDetails(details, false, false, messageId, null);
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
final String reason = "testSendErrorReason";
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason);
CoordinatorClient.getClient().sendSoapFault(coordinatorEndpoint, map, soapFault, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
assertEquals(details.hasSoapFault().getReason(), soapFault.getReason());
assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode());
checkDetails(details, false, false, messageId, instanceIdentifier);
}
Aggregations