Does anyone have any experience in SOAP UserNameToken (Hash) generation?
it generates the soap headers like this:
<wsse:Security xmlns:wsse="http://...wsssecurity...">
<wsse:UserNameToken xmlns:wsse="http://...wsssecurity...">
<Username xmlns="">myname</Username>
<Password xmlns="">mypass</Password>
</wsse:UserNameToken>
</wsse:Security>
How do I generate the UserNameToken in the correct way (as SoapUi does automatically)?
In Java you can use WSS4J and make the header yourself?
But how can I do this in a scala file or are there any better options?
SOAPPart soappart = message.getSOAPPart();
SOAPEnvelope envelope = soappart.getEnvelope();
SOAPHeader header = envelope.getHeader();
WSSecHeader wsheader = new WSSecHeader();
wsheader.insertSecurityHeader(soappart);
WSSecUsernameToken token = new WSSecUsernameToken();
token.setPasswordType(WSConstants.PASSWORD_DIGEST);
token.setUserInfo("myuser", "mypass");
token.build(soappart, wsheader);