I try to invoke HTTPS SOAP web service through java code:
URL url = new URL(\"https://somehost:8181/services/\"SomeService?wsdl\");
QName qname = new
I have followed the steps mentioned by @LaabidiRaissi. The code works fine but it never appends the security element under the header. I have confirmed it by printing out the outbound SOAP message to System.out. After a deep research, I have found that the SOAPMessage needs to be explicitly saved for reflecting the updated message header.
soapMessage.saveChanges();
For more reference - Check this link