Skip to content

AbstractSoapMessage.getPayloadSource returns null with Axis SAAJ [SWS-87] #247

Closed
@gregturn

Description

@gregturn

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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions