use of com.arjuna.webservices11.SoapFault11 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.SoapFault11 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.SoapFault11 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.SoapFault11 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.SoapFault11 in project narayana by jbosstm.
the class ActivationCoordinator method createCoordinationContext.
/**
* Create the coordination context.
* @param activationCoordinatorURI The URI of the activation coordinator.
* @param messageID The messageID to use.
* @param coordinationTypeURI The coordination type.
* @param expires The expiry time or null.
* @param currentContext The currnt context or null.
* @return The coordination context.
* @throws com.arjuna.wsc.InvalidCreateParametersException if the create parameters are invalid.
* @throws SoapFault for errors during processing.
*/
public static CoordinationContextType createCoordinationContext(final String activationCoordinatorURI, final String messageID, final String coordinationTypeURI, final Long expires, final CoordinationContext currentContext) throws InvalidCreateParametersException, SoapFault {
final MAP map = AddressingHelper.createRequestContext(activationCoordinatorURI, messageID);
final Expires expiresValue;
if (expires == null) {
expiresValue = null;
} else {
expiresValue = new Expires();
expiresValue.setValue(expires.longValue());
}
try {
CreateCoordinationContextResponseType response;
ActivationCoordinatorClient client = ActivationCoordinatorClient.getClient();
response = client.sendCreateCoordination(map, coordinationTypeURI, expiresValue, currentContext);
return response.getCoordinationContext();
} catch (final IOException ioe) {
throw new SoapFault11(ioe);
} catch (SOAPFaultException sfe) {
// TODO -- work out which faults we should really throw. in particular do we need to retain SoapFault
final SOAPFault soapFault = sfe.getFault();
final QName subcode = soapFault.getFaultCodeAsQName();
if (CoordinationConstants.WSCOOR_ERROR_CODE_INVALID_PARAMETERS_QNAME.equals(subcode)) {
Detail detail = soapFault.getDetail();
String message = (detail != null ? detail.getTextContent() : soapFault.getFaultString());
throw new InvalidCreateParametersException(message);
}
throw SoapFault11.create(sfe);
}
}
Aggregations