use of com.arjuna.webservices.SoapFault in project narayana by jbosstm.
the class TerminationCoordinatorProcessorImpl method complete.
/**
* Complete.
* @param complete The complete notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public void complete(final NotificationType complete, final MAP map, final ArjunaContext arjunaContext) {
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final BusinessActivityTerminator participant = getParticipant(instanceIdentifier);
try {
if (participant != null) {
W3CEndpointReference endpoint = participant.getEndpoint();
final String messageId = MessageId.getMessageId();
try {
participant.complete();
} catch (final FaultedException fe) {
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendFaulted(endpoint, responseMAP, instanceIdentifier);
} catch (final UnknownTransactionException ute) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_12());
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final SystemException se) {
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final String message = WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_13();
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME, message);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
} catch (final Throwable th) {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Unexpected exception thrown from complete:", th);
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, messageId);
final SoapFault soapFault = new SoapFault11(th);
TerminationParticipantClient.getClient().sendSoapFault(endpoint, faultMAP, soapFault, instanceIdentifier);
return;
}
final MAP responseMAP = AddressingHelper.createNotificationContext(messageId);
TerminationParticipantClient.getClient().sendCompleted(endpoint, responseMAP, instanceIdentifier);
} else {
if (WSTLogger.logger.isTraceEnabled()) {
WSTLogger.logger.tracev("Complete called on unknown participant: {0}", new Object[] { instanceIdentifier });
}
final MAP faultMAP = AddressingHelper.createFaultContext(map, MessageId.getMessageId());
final SoapFault soapFault = new SoapFault11(SoapFaultType.FAULT_SENDER, ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME, WSTLogger.i18NLogger.get_wst11_messaging_TerminationCoordinatorProcessorImpl_16());
TerminationParticipantClient.getClient().sendSoapFault(soapFault, faultMAP, instanceIdentifier);
}
} catch (Throwable throwable) {
throwable.printStackTrace(System.err);
}
}
use of com.arjuna.webservices.SoapFault 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);
}
use of com.arjuna.webservices.SoapFault 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);
}
use of com.arjuna.webservices.SoapFault 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);
;
}
});
}
use of com.arjuna.webservices.SoapFault 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);
;
}
});
}
Aggregations