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()));
}
boolean foundSOAPFault = false;
String soapFaultUse = "";
String soapFaultNamespace = "";
Iterator faultIter =
bFault.getExtensibilityElements().iterator();
for (; faultIter.hasNext();) {
Object obj = faultIter.next();
if (obj instanceof SOAPFault) {
foundSOAPFault = true;
soapFaultUse = ((SOAPFault) obj).getUse();
soapFaultNamespace = ((SOAPFault) obj).getNamespaceURI();
break;
} else if (obj instanceof UnknownExtensibilityElement) {
// TODO: After WSDL4J supports soap12, change this code
UnknownExtensibilityElement unkElement =
(UnknownExtensibilityElement) obj;
QName name =
unkElement.getElementType();
if (name.getNamespaceURI().equals(Constants.URI_WSDL12_SOAP)
&& name.getLocalPart().equals("fault")) {
if (unkElement.getElement().getAttribute("use")
!= null) {
soapFaultUse =
unkElement.getElement().getAttribute("use");
}
if (unkElement.getElement().getAttribute("namespace")
!= null) {
soapFaultNamespace =
unkElement.getElement().getAttribute(
"namespace");
}
}
}
}
// Check to make sure we have a soap:fault element
if (!foundSOAPFault) {
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