public void addSoapFaultToMessageContext(MessageContext msgContext, String faultCode,
String faultReason, String faultDetail) throws AxisFault {
SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
SOAPEnvelope faultEnvelope = factory.getDefaultFaultEnvelope();
SOAPFault soapFault = faultEnvelope.getBody().getFault();
SOAPFaultCode soapFaultCode = factory.createSOAPFaultCode();
soapFaultCode.setText(faultCode);
soapFault.setCode(soapFaultCode);
SOAPFaultReason soapFaultReason = factory.createSOAPFaultReason();
soapFaultReason.setText(faultReason);
soapFault.setReason(soapFaultReason);
SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail();
soapFaultDetail.setText(faultDetail);
soapFault.setDetail(soapFaultDetail);
msgContext.setEnvelope(faultEnvelope);
}