soap with attachments (swa) combined with payload
To implement Soap with Attachments (SwA) within Spring Web services I am simply implementing MessageEndpoint and then in the invoke(MessageContext) method I cast messageContext.getRequest() to a SoapMessage. From then I can get the attachment.
However, to also process some message payload (not the attachment part) I am basically writing the implementation of AbstractJDomPayloadEndpoint myself (or one of the other payload endpoints such as AbstractMarshallingPayloadEndpoint).
It appears to me that there is no way to extend one of the payload endpoint and get the attachment, as I don't seem to have access to the MessageContext.
It seems a bit odd that I can't get to the MessageContext while utilising one of the payload endpoints. So if I want to use attachments I have to write my own payload endpoint.
Axis2 has MessageContext.getCurrentMessageContext() that can be called from within a service that marshalls/unmarshalls the payload.
1. Am I right in my implementation of SwA in Spring Web Services?
2. Is there a better way to process both the attachment and the message payload?