I'm using SOAPHandler.handleMessage(...) to intercept outgoint SOAP messages from client to server.
I need to confirm that the interception takes place after the message has been sent. Not sure if this is really the case. Any ideas?
I'm using SOAPHandler.handleMessage(...) to intercept outgoint SOAP messages from client to server.
I need to confirm that the interception takes place after the message has been sent. Not sure if this is really the case. Any ideas?
There's a simple trick to check your assumption. Add this code in handleMessage
method:
SOAPMessage msg = ((SOAPMessageContext) context).getMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope env = sp.getEnvelope();
Now when you have a SOAPEnvelope
try to alternate SOAP message and see what happens when receiver receives it. I will spoil the surprise and reveal you: it will be changed :-)
Thus, your SOAPHandler intercepts the message before it's actually sent.