private BindingFaultElement parseBindingFault(XMLElement bindFaultEl,
DescriptionElement desc,
BindingElement parent)
throws WSDLException {
BindingFaultElement fault = parent.addBindingFaultElement();
QName intFltQN = null;
String ref = bindFaultEl.getAttributeValue(Constants.ATTR_REF);
if(ref != null)
{
try {
intFltQN = bindFaultEl.getQName(ref);
fault.setRef(intFltQN);
} catch (WSDLException e) {
getErrorReporter().reportError(
new ErrorLocatorImpl(), //TODO line&col nos.
"WSDL505",
new Object[] {ref, bindFaultEl.getQName()},
ErrorReporter.SEVERITY_ERROR);
}
}
parseExtensionAttributes(bindFaultEl, BindingFaultElement.class, fault, desc);
/* Parse the child elements of binding <fault>.
* As per WSDL 2.0 spec, they must be in the following order if present:
* <documentation>
* extension elements in any order
* TODO validate that the elements are in correct order
*/
XMLElement[] children = bindFaultEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
for(int i=0; i<children.length; i++)
{
tempEl = children[i];
tempElQN = tempEl.getQName();
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
{
parseDocumentation(tempEl, desc, fault);
}
else
{
fault.addExtensionElement(
parseExtensionElement(BindingFaultElement.class, fault, tempEl, desc) );
}
}
return fault;