public static SoapFault11 fromFault(Fault fault) { try { QName subcode = fault.getFaultcode(); String reason = fault.getFaultstring(); return new SoapFault11(SoapFaultType.FAULT_SENDER, subcode, reason); } catch (Throwable th) { return new SoapFault11(th); } }
private static void throwException(QName subcode, String detail, SOAPFaultException sfe, Fault fault) throws CannotRegisterException, InvalidProtocolException, InvalidStateException, SoapFault { if (CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME.equals(subcode)) { throw new CannotRegisterException(detail); } else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME.equals(subcode)) { throw new InvalidProtocolException(detail); } else if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME.equals(subcode)) { throw new InvalidStateException(detail); } if (sfe != null) { throw SoapFault11.create(sfe); } else { throw SoapFault11.fromFault(fault); } }
/** * Create a custom SOAP fault. * @param soapFaultType the soap fault type. * @param subcode The fault subcode. * @param reason The fault reason. * @param detailElement The fault detailElement. */ public SoapFault11(final SoapFaultType soapFaultType, final QName subcode, final String reason, final Element detailElement) { super(soapFaultType, subcode, reason, getDetailString(detailElement)) ; this.detailElement = detailElement; }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
@WebMethod(operationName = "fault", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/fault") @Oneway public void fault( @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() { TerminationCoordinatorProcessor.getProcessor().soapFault(soapFault, inboundMap, arjunaContext); ; } }) ; } }
/** * Send a rollback 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 boolean sendRollback(final W3CEndpointReference endpoint, final MAP map) throws SoapFault, IOException { CompletionCoordinatorRPCPortType port = getPort(endpoint, map, rollbackAction); Notification rollback = new Notification(); try { return port.rollbackOperation(rollback); } catch (SOAPFaultException sfe) { throw SoapFault11.create(sfe); } }
throw new SoapFault11(ioe) ; } catch (SOAPFaultException sfe) { throw new InvalidCreateParametersException(message); throw SoapFault11.create(sfe);
/** * Send a fault. * @param map The addressing context. * @param soapFault The SOAP fault. * @param identifier The arjuna instance identifier. * @throws com.arjuna.webservices.SoapFault For any errors. * @throws java.io.IOException for any transport errors. */ public void sendSoapFault(final SoapFault soapFault, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException { final TerminationParticipantPortType port = getPort(map, identifier, soapFaultAction); SoapFault11 soapFault11 = (SoapFault11)soapFault; Fault fault = soapFault11.toFault(); port.faultOperation(fault); }
public Fault toFault() { Fault fault = factory.createFault(); QName faultcode = subcode; String faultstring = getReason(); fault.setFaultcode(faultcode); fault.setFaultstring(faultstring); return fault; }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
@WebMethod(operationName = "fault", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/fault") @Oneway public void fault( @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() { TerminationCoordinatorProcessor.getProcessor().soapFault(soapFault, inboundMap, arjunaContext); ; } }) ; } }
/** * Send a commit 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 boolean sendCommit(final W3CEndpointReference endpoint, final MAP map) throws SoapFault, IOException { CompletionCoordinatorRPCPortType port = getPort(endpoint, map, commitAction); Notification commit = new Notification(); try { return port.commitOperation(commit); } catch (SOAPFaultException sfe) { throw SoapFault11.create(sfe); } }
throw new SoapFault11(ioe) ; } catch (SOAPFaultException sfe) { throw new InvalidCreateParametersException(message); throw SoapFault11.create(sfe);
/** * Send a fault. * @param map The addressing context. * @param soapFault The SOAP fault. * @param identifier The arjuna instance identifier. * @throws com.arjuna.webservices.SoapFault For any errors. * @throws java.io.IOException for any transport errors. */ public void sendSoapFault(final SoapFault soapFault, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException { final TerminationParticipantPortType port = getPort(map, identifier, soapFaultAction); SoapFault11 soapFault11 = (SoapFault11)soapFault; Fault fault = soapFault11.toFault(); port.faultOperation(fault); }
public Fault toFault() { Fault fault = factory.createFault(); QName faultcode = subcode; String faultstring = getReason(); fault.setFaultcode(faultcode); fault.setFaultstring(faultstring); return fault; }
public static SoapFault11 fromFault(Fault fault) { try { QName subcode = fault.getFaultcode(); String reason = fault.getFaultstring(); return new SoapFault11(SoapFaultType.FAULT_SENDER, subcode, reason); } catch (Throwable th) { return new SoapFault11(th); } }
public void close () throws TransactionRolledBackException, UnknownTransactionException, SystemException { final MAP map = AddressingHelper.createNotificationContext(MessageId.getMessageId()) ; try { TerminationCoordinatorRPCClient.getClient().sendClose(_terminationCoordinator, map, new InstanceIdentifier(_id)) ; } catch (SoapFault11 soapFault) { if ((ArjunaTXConstants.TRANSACTIONROLLEDBACK_ERROR_CODE_QNAME.equals(soapFault.getSubcode()))) { throw new TransactionRolledBackException(soapFault.getMessage()); } else if (ArjunaTXConstants.UNKNOWNTRANSACTION_ERROR_CODE_QNAME.equals(soapFault.getSubcode())) { throw new UnknownTransactionException(soapFault.getMessage()) ; } throw new SystemException(soapFault.getMessage()) ; } catch (Exception e) { throw new SystemException(); } }
@WebMethod(operationName = "fault", action = "http://docs.oasis-open.org/ws-tx/wsat/2006/06/fault") @Oneway public void fault( @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() { TerminationCoordinatorProcessor.getProcessor().soapFault(soapFault, inboundMap, arjunaContext); ; } }) ; } }
/** * Send a complete 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 sendComplete(final W3CEndpointReference coordinator, final MAP map, final InstanceIdentifier identifier) throws SoapFault11, IOException { final TerminationCoordinatorRPCPortType port = getPort(coordinator, map, completeAction); final NotificationType complete = new NotificationType(); try { port.completeOperation(complete); } catch (SOAPFaultException sfe) { throw SoapFault11.create(sfe); } }
throw new SoapFault11(ioe) ; } catch (SOAPFaultException sfe) { throw new InvalidCreateParametersException(message); throw SoapFault11.create(sfe);