Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
None
-
JDK 1.4.2
Windows XP
Description
When you have a soap 1.2 binding with soap fault, the fault element is not correctly extracted, resulting in error
ERROR: Missing <soap:fault> element inFault "..." in operation "...", in binding ...
This is caused by the missing statement that sets the local variable foundSOAPFault in the faultsFromSOAPFault method of the org.apache.axis.wsdl.symbolTable.SymbolTable class.
In particular, the current 1.4 code shows:
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)
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())); }
Note that variable foundSOAPFault is not set for the SOAP 1.2 binding. This causes a WSDL with soap fault to throw an missingSoapFault00 exception.
Adding the statement foundSOAPFault = true, as shown below, will fix this problem.
...
} 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")) {
foundSOAPFault = true;
if (unkElement.getElement().getAttribute("use")
!= null) { soapFaultUse = unkElement.getElement().getAttribute("use"); }
if (unkElement.getElement().getAttribute("namespace")
!= null)
}
}
...