I'm consuming a web service which has a login method that needs to be called before sending any further requests. The login method response has a MimeHeader called "Set-Cookie" and the value of this header needs to be added as a request MimeHeader called "Cookie" to the subsequent requests. So my question is.........how can I do this in Spring Integration
So far my solution involves too much custom code for my liking. I've created a message extractor that looks for the "Set-Cookie" mime header and adds it as a SI message header and used that as the message extractor for the SimpleWebServiceOutboundGateway that calls the login method. Then I've had to create a request call back that takes the SI header and sets it as a MimeHeader on the outgoing SoapMessage for the other SimpleWebServiceOutboundGateway. The biggest problem is that request callbacks don't have access to the SI message. The only one that could is the private one that deals with SoapActions actually in the SimpleWebServiceOutboundGateway class. So, I've had to override this class in my app with my own version which obviously is not good!
Do you have any suggestions of what else I could do?