Description
Brad Harvey opened SWS-87 and commented
Hi,
I have some more woes with Axis SAAJ. This problem doesn't occur with jdk1.5 and Sun's SAAJ implementation, so it may well be the result of an axis bug.
The payload logging interceptor isn't logging responses for me, but requests get logged fine. It turns out that getPayloadSource() was returning null.
I traced it through to getFirstBodyElement(SOAPBody) in Saaj12Implementation:
public SOAPBodyElement getFirstBodyElement(SOAPBody body) {
for (Iterator iterator = body.getChildElements(); iterator.hasNext();) {
Object child = iterator.next();
if (child instanceof SOAPBodyElement) {
return (SOAPBodyElement) child;
}
}
return null;
}
The child it found was actually an instance of SOAPElement, not SOAPBodyElement.
body.getClass()
(java.lang.Class<T>) class org.apache.axis.message.SOAPBody
child.getClass()
(java.lang.Class<T>) class org.apache.axis.message.MessageElement
public class org.apache.axis.message.MessageElement extends org.apache.axis.message.NodeImpl implements javax.xml.soap.SOAPElement, (etc)
The javadoc for SOAPBody certainly implies that it should be a SOAPBodyElement, but it doesn't look as if SOAPBodyElement adds anything over SOAPElement so perhaps it can check for and return that instead?
Thanks,
Brad.
Affects: 1.0 M3
Attachments:
- ResponsePayloadTest.java (1.23 kB)