*/
private void faultsFromSOAPFault(Binding binding, BindingOperation bindOp,
Operation operation, ArrayList faults) throws IOException {
Iterator faultMapIter = bindOp.getBindingFaults().values().iterator();
for (; faultMapIter.hasNext(); ) {
BindingFault bFault = (BindingFault)faultMapIter.next();
// Set default entry for this fault
String faultName = bFault.getName();
// Check to make sure this fault is named
if (faultName == null || faultName.length() == 0) {
throw new IOException(Messages.getMessage("unNamedFault00",
bindOp.getName(),
binding.getQName().toString()));
}
SOAPFault soapFault = null;
Iterator faultIter = bFault.getExtensibilityElements().iterator();
for (; faultIter.hasNext();) {
Object obj = faultIter.next();
if (obj instanceof SOAPFault) {
soapFault = (SOAPFault) obj;
break;
}
}
// Check to make sure we have a soap:fault element
if (soapFault == null) {
throw new IOException(Messages.getMessage("missingSoapFault00",
faultName,
bindOp.getName(),
binding.getQName().toString()));
}
// TODO error checking:
// if use=literal, no use of namespace on the soap:fault
// if use=encoded, no use of element on the part
// Check this fault to make sure it matches the one
// in the matching portType Operation
Fault opFault = operation.getFault(bFault.getName());
if (opFault == null) {
throw new IOException(Messages.getMessage("noPortTypeFault",
new String[] {bFault.getName(),
bindOp.getName(),
binding.getQName().toString()}));
}
// put the updated entry back in the map
faults.add(new FaultInfo(opFault,