use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class CompletionInitiatorClient method sendSoapFault.
/**
* Send a fault for an unknown participant.
* @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 MAP map, final SoapFault soapFault, final InstanceIdentifier identifier) throws SoapFault, IOException {
CompletionInitiatorPortType port = getPort(null, map, faultAction);
// convert fault to the wire format and dispatch it to the initiator
soapFault.setAction(faultAction);
Fault fault = ((SoapFault11) soapFault).toFault();
port.soapFault(fault);
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class CompletionInitiatorClient method sendSoapFault.
/**
* 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 W3CEndpointReference participant, final MAP map, final SoapFault soapFault, final InstanceIdentifier identifier) throws SoapFault, IOException {
CompletionInitiatorPortType port = getPort(participant, map, faultAction);
// convert fault to the wire format and dispatch it to the initiator
soapFault.setAction(faultAction);
Fault fault = ((SoapFault11) soapFault).toFault();
port.soapFault(fault);
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class ParticipantClient method sendSoapFault.
/**
* 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 MAP map, final SoapFault soapFault, final InstanceIdentifier identifier) throws SoapFault, IOException {
ParticipantPortType port = getPort(null, map, faultAction);
// convert fault to the wire format and dispatch it to the initiator
soapFault.setAction(faultAction);
Fault fault = ((SoapFault11) soapFault).toFault();
port.soapFault(fault);
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class TerminationParticipantClient method sendSoapFault.
/**
* 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);
}
use of com.arjuna.webservices11.wsarj.InstanceIdentifier in project narayana by jbosstm.
the class RegistrationCoordinatorProcessorImpl method register.
/**
* Register the participant in the protocol.
* @param register The register request.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/
public RegisterResponseType register(final RegisterType register, final MAP map, final ArjunaContext arjunaContext, final boolean isSecure) {
final com.arjuna.wsc11.RegistrarMapper registrarMapper = RegistrarMapper.getFactory();
try {
final String protocolIdentifier = register.getProtocolIdentifier();
final Registrar registrar = registrarMapper.getRegistrar(protocolIdentifier);
if (registrar != null) {
try {
final W3CEndpointReference participantProtocolService = register.getParticipantProtocolService();
final InstanceIdentifier instanceIdentifier = arjunaContext.getInstanceIdentifier();
final W3CEndpointReference coordinationProtocolService = registrar.register(participantProtocolService, protocolIdentifier, instanceIdentifier, isSecure);
final RegisterResponseType response = new RegisterResponseType();
response.setCoordinatorProtocolService(coordinationProtocolService);
return response;
} catch (final AlreadyRegisteredException alreadyRegisteredException) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(WSCLogger.i18NLogger.get_wsc11_messaging_RegistrationCoordinatorProcessorImpl_1());
throw new SOAPFaultException(soapFault);
} catch (final InvalidProtocolException invalidProtocolException) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.i18NLogger.get_wsc11_messaging_RegistrationCoordinatorProcessorImpl_2());
throw new SOAPFaultException(soapFault);
} catch (final InvalidStateException InvalidStateException) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_STATE_QNAME).addTextNode(WSCLogger.i18NLogger.get_wsc11_messaging_RegistrationCoordinatorProcessorImpl_3());
throw new SOAPFaultException(soapFault);
} catch (final NoActivityException noActivityException) {
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(WSCLogger.i18NLogger.get_wsc11_messaging_RegistrationCoordinatorProcessorImpl_4());
throw new SOAPFaultException(soapFault);
} catch (final Throwable th) {
if (WSCLogger.logger.isTraceEnabled()) {
WSCLogger.logger.tracev("Unexpected exception thrown from create:", th);
}
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_CANNOT_REGISTER_QNAME).addTextNode(th.getMessage());
throw new SOAPFaultException(soapFault);
}
} else {
if (WSCLogger.logger.isTraceEnabled()) {
WSCLogger.logger.tracev("Register called for unknown protocol identifier: {0}", new Object[] { protocolIdentifier });
}
SOAPFactory factory = SOAPFactory.newInstance();
SOAPFault soapFault = factory.createFault(SoapFaultType.FAULT_SENDER.getValue(), CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PROTOCOL_QNAME);
soapFault.addDetail().addDetailEntry(CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME).addTextNode(WSCLogger.i18NLogger.get_wsc11_messaging_RegistrationCoordinatorProcessorImpl_2());
throw new SOAPFaultException(soapFault);
}
} catch (SOAPException se) {
se.printStackTrace(System.err);
throw new ProtocolException(se);
}
}
Aggregations