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);
referenceRMMsgContext.setProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
} else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals (SOAPNamespaceValue)) {
reason.setText(data.getReason());
referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_CODE_LOCAL_NAME, faultCode);
referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_DETAIL_LOCAL_NAME, detail);
referenceRMMsgContext.setProperty(SOAP11Constants.SOAP_FAULT_STRING_LOCAL_NAME, reason);
// Need to send this message as the Axis Layer doesn't set the "SequenceFault" header
MessageContext faultMessageContext =