You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had to extend AxiomSoapMessage to override the writeTo method so that I could correctly handle returning a PDF file as an MTOM attachement in a response message. My extension delegates to 'normal' instance of AxiomSoapMessage to perform most all functionality except that it intercepts the writeTo method to set the options I need on the OMOutputFormat object and correctly set the content type.
Now I have to add security to it (using the wss4j interceptor). For now I need to add the WS-Security Timestamp element to the response. The problem I have is that wss4j Interceptor (and wss4j handler) creates a new AxiomSoapMessage instance. I need to intercept the setAxiomSoapMessage method so I can save the new instance as my delegate object; but I can't because the method is declared final in AxiomSoapMessage class.
snicoll
changed the title
Extending AxiomSoapMessage difficult due to final methods [SWS-388]
Add support for customizing AxiomSoapMessage#writeTo
Mar 17, 2025
I am looking at the current AxiomSoapMessage and I agree that the method is doing quite a bit there. I've added something that hopefully should help you, if that still makes sense.
Martin Bosak opened SWS-388 and commented
I had to extend AxiomSoapMessage to override the writeTo method so that I could correctly handle returning a PDF file as an MTOM attachement in a response message. My extension delegates to 'normal' instance of AxiomSoapMessage to perform most all functionality except that it intercepts the writeTo method to set the options I need on the OMOutputFormat object and correctly set the content type.
Now I have to add security to it (using the wss4j interceptor). For now I need to add the WS-Security Timestamp element to the response. The problem I have is that wss4j Interceptor (and wss4j handler) creates a new AxiomSoapMessage instance. I need to intercept the setAxiomSoapMessage method so I can save the new instance as my delegate object; but I can't because the method is declared final in AxiomSoapMessage class.
FYI, here is my modified writeTo method:
Affects: 1.5.3
2 votes, 3 watchers
The text was updated successfully, but these errors were encountered: