SandeshaMessageKeys.soapEnvNotSet));
SOAPFactory factory = SOAPAbstractFactory.getSOAPFactory(SandeshaUtil
.getSOAPVersion(faultEnvelope));
SOAPFault fault = faultEnvelope.getBody().getFault();
if (fault == null)
throw new SandeshaException(SandeshaMessageHelper.getMessage(
SandeshaMessageKeys.noFaultCode,
faultEnvelope.toString()));
SOAPFaultCode faultCode = fault.getCode();
SOAPFaultValue codeValue = faultCode.getValue();
codeValue.setText(data.getCode());
SOAPFaultSubCode faultSubCode = factory
.createSOAPFaultSubCode(faultCode);
SOAPFaultValue subCodeValue = factory
.createSOAPFaultValue(faultSubCode);
subCodeValue.setText(data.getSubcode());
SOAPFaultReason faultReason = fault.getReason();
SOAPFaultText faultText = faultReason.getSOAPFaultText("en");
if (faultText==null) {
faultText = factory.createSOAPFaultText();
faultReason.addSOAPText(faultText);
}
if (data!=null && data.getReason()!=null)
faultText.setText(data.getReason());
SOAPFaultDetail faultDetail = fault.getDetail();
OMElement detailElement = data.getDetail();
if (detailElement != null)
faultDetail.addChild(detailElement);