Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.4
-
None
-
None
-
JDK 1.4, Win XP
Description
org.apache.axis.providers.java.RPCProvider's getBody is suposed to return an RPCElement.
When the actual SOAP body contains the plain SOAPBodyElement and not the RPCElement, it instantiates an RPCElement with the content of the SOAPBodyElement. But this code does not work when the operation has no parameter, as param is returned as null to skip the body creation block.
if (!(bodies.get(bNum) instanceof RPCElement)) {
SOAPBodyElement bodyEl = (SOAPBodyElement) bodies.get(bNum);
// igors: better check if bodyEl.getID() != null
// to make sure this loop does not step on SOAP-ENC objects
// that follow the parameters! FIXME?
if (bodyEl.isRoot() && operation != null && bodyEl.getID() == null) {
ParameterDesc param = operation.getParameter(bNum);
// at least do not step on non-existent parameters!
if (param != null) {
Object val = bodyEl.getValueAsType(param.getTypeQName());
body = new RPCElement("",
operation.getName(),
new Object[]
}
}
} else {
In order to fix this problem, the above code needs to be modified to:
if (!(bodies.get(bNum) instanceof RPCElement)) {
SOAPBodyElement bodyEl = (SOAPBodyElement) bodies.get(bNum);
// igors: better check if bodyEl.getID() != null
// to make sure this loop does not step on SOAP-ENC objects
// that follow the parameters! FIXME?
if (bodyEl.isRoot() && operation != null && bodyEl.getID() == null) {
ParameterDesc param = operation.getParameter(bNum);
// at least do not step on non-existent parameters!
QName qname = operation.getElementQName();
if (param != null) {
Object val = bodyEl.getValueAsType(param.getTypeQName());
body = new RPCElement(qname.getNamespaceURI(),
qname.getLocalPart(),
new Object[]{val}
);
} else {
body = new RPCElement(qname.getNamespaceURI(),
qname.getLocalPart(),
new Object[]{});
}
}
} else {