reason.setText(fault.getErrorCode());
}
private void createFaultDetail(SOAPFactory factory, SOAPFault soapFault, CougarFault fault, SoapOperationBinding binding) throws Exception {
SOAPFaultDetail soapFaultDetail = factory.createSOAPFaultDetail(soapFault);
FaultDetail detail = fault.getDetail();
if (detail != null) {
List<String[]> faultMessages = detail.getFaultMessages();
if (faultMessages != null && faultMessages.size() > 0) {
OMNamespace ns = factory.createOMNamespace(binding
.getServiceBindingDescriptor().getNamespaceURI(), binding
.getServiceBindingDescriptor().getNamespacePrefix());
OMElement faultNode = factory.createOMElement(detail.getFaultName(), ns);
for (String[] msg : faultMessages) {
OMElement messageNode = factory.createOMElement(msg[0], ns);
messageNode.setText(msg[1]);
faultNode.addChild(messageNode);
}
soapFaultDetail.addChild(faultNode);
}
if (FaultController.getInstance().isDetailedFaults()) {
OMElement stackTrace = factory.createOMElement(new QName("trace"));
stackTrace.setText(detail.getStackTrace());
soapFaultDetail.addChild(stackTrace);
OMElement detailedMessage = factory.createOMElement(new QName("message"));
detailedMessage.setText(detail.getDetailMessage());
soapFaultDetail.addChild(detailedMessage);
}
}
}