Skip to content

Using Axiom with payload caching off sometimes creates empty soap bodies [SWS-359] #510

@gregturn

Description

@gregturn

Jim Cummings opened SWS-359* and commented

It appears that if you're using Castor to marshal your responses, and you're using Axiom without payload caching, that the SOAP response comes back with an empty Soap Body. I did not try this with other Marshalling technologies like JAXB, etc, so I'm not sure if it is restricted to Castor only or not.

It looks like NonCachingPayload.DelegatingStreamWriter.writeEndDocument() never gets called at least when marshalling with Castor. Castor by default does not fire an endDocument SAX event (or close or flush for that matter). But if you call setMarshalAsDocument(true) on a castor marshaller it does call endDocument().

I just now worked around this with Castor by creating a simple subclass of CastorMarshaller like this below:
public class MyCastorMarshaller extends CastorMarshaller {
protected void customizeMarshaller(Marshaller marshaller) {
super.customizeMarshaller(marshaller);
marshaller.setMarshalAsDocument(true);
}
}

See this forum thread for additional details: http://forum.springframework.org/showthread.php?p=181732&posted=1#post181732


Affects: 1.5.2

Referenced from: commits b8effcb

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions