* @param sourceSubCode
*/
private static void copySOAPFaultSubCode(SOAPFactory factory,
OMElement targetParent,
SOAPFaultSubCode sourceSubCode) {
SOAPFaultSubCode targetSubCode;
if (targetParent instanceof SOAPFaultSubCode) {
targetSubCode = factory.createSOAPFaultSubCode((SOAPFaultSubCode) targetParent);
} else {
targetSubCode = factory.createSOAPFaultSubCode((SOAPFaultCode) targetParent);
}
copyTagData(sourceSubCode, targetSubCode);
// Process the SOAP FaultValue
SOAPFaultValue sourceValue = sourceSubCode.getValue();
SOAPFaultValue targetValue = factory.createSOAPFaultValue(targetSubCode);
copyTagData(sourceValue, targetValue);
// There should only be a text node for the value, but in case there is more
Iterator i = sourceValue.getChildren();
while (i.hasNext()) {
OMNode node = (OMNode) i.next();
copy(factory, targetValue, node);
}
// Now process the SubCode of the SubCode
SOAPFaultSubCode sourceSubSubCode = sourceSubCode.getSubCode();
if (sourceSubSubCode != null) {
copySOAPFaultSubCode(factory, targetSubCode, sourceSubSubCode);
}
}