public static void getOrSendFault(RMMsgContext referenceRMMsgContext, FaultData data, boolean throwable) throws AxisFault {
SOAPFactory factory = (SOAPFactory) referenceRMMsgContext.getSOAPEnvelope().getOMFactory();
SOAPFaultCode faultCode = factory.createSOAPFaultCode();
SOAPFaultSubCode faultSubCode = factory.createSOAPFaultSubCode(faultCode);
SOAPFaultValue faultColdValue = factory.createSOAPFaultValue(faultCode);
SOAPFaultValue faultSubcodeValue = factory.createSOAPFaultValue(faultSubCode);
faultColdValue.setText(data.getCode());
faultSubcodeValue.setText(data.getSubcode());
faultCode.setSubCode(faultSubCode);
SOAPFaultReason reason = factory.createSOAPFaultReason();
SOAPFaultText reasonText = factory.createSOAPFaultText();
reasonText.setText(data.getReason());
SOAPFaultDetail detail = factory.createSOAPFaultDetail();
detail.addDetailEntry(data.getDetail());
String SOAPNamespaceValue = factory.getSoapVersionURI();
if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(SOAPNamespaceValue)) {
reason.addSOAPText(reasonText);
referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME, reason);