We are implementing a web service that is going to act as an intermediary layer between the clients and another application. Our requirements for the web service state that we need to send the username and password in the SOAP header using standard WS-Security.
The web service implementation needs to take the information passed in through the method call and combine that with the username and password in order to call the other application, and this is where my problem starts.
I cannot figure out an easy way to get to the username and password from the SOAP header within my web service implementation. I can get to the user principal (username) through the injected WebServiceContext, but I don't see any easy way to get the password.
I can get to the SOAPHeader and could probably parse the XML to get the password element, but this seems like a very messy way to solve this problem.
I'm not as knowledgeable about JAX-WS and WS-Security as I'd like to be. I'm hoping that I'm missing something that obvious to somebody else - maybe I need to implement some kind of handler?