private void processOperationFault(WSDLInterfaceOperation destOperation, WSDLInterface destInterface, Fault srcFault) throws WSDLException
{
String faultName = srcFault.getName();
log.trace("processOperationFault: " + faultName);
WSDLInterfaceFault destFault = new WSDLInterfaceFault(destInterface, faultName);
Message message = srcFault.getMessage();
QName messageName = message.getQName();
Map partsMap = message.getParts();
if (partsMap.size() != 1)
throw new WSDLException(WSDLException.INVALID_WSDL, "Unsupported number of fault parts in message " + messageName);
Part part = (Part)partsMap.values().iterator().next();
QName xmlName = part.getElementName();
if (xmlName != null)
{
destFault.setElement(xmlName);
}
else
{
destFault.setElement(messageName);
log.warn("Unsupported fault message part in message: " + messageName);
}
// Add the fault to the interface
destInterface.addFault(destFault);
// Add the fault refererence to the operation
WSDLInterfaceOperationOutfault opOutFault = new WSDLInterfaceOperationOutfault(destOperation);
opOutFault.setRef(destFault.getName());
destOperation.addOutfault(opOutFault);
}