XMLFault xmlFault = new XMLFault(code, reason, detailBlocks);
// Add the secondary fault information
// Get the SubCodes
SOAPFaultSubCode soapSubCode = soapCode.getSubCode();
if (soapSubCode != null) {
List<QName> list = new ArrayList<QName>();
// Walk the nested sub codes and collect the qnames
while (soapSubCode != null) {
SOAPFaultValue soapSubCodeValue = soapSubCode.getValue();
QName qName = soapSubCodeValue.getTextAsQName();
list.add(qName);
soapSubCode = soapSubCode.getSubCode();
}
// Put the collected sub code qnames onto the xmlFault
QName[] qNames = new QName[list.size()];
xmlFault.setSubCodes(list.toArray(qNames));