I\'m generating client java code from a wsdl using \'wsimport\'. The wsdl has soap:header in the operation definitions like this
I could not comment so I am writing this here as an "answer".
I ran into the same situation where there was only body in the envelope. However after adding the '-XadditionalHeaders' argument, wsimport still refused to generate service methods with header arguments. I searched on the Internet and found a manual patch in the following link:
https://metro.java.net/2.0/guide/SOAP_headers.html
I did not do it in the code. Instead I changed the method signature of the web service operation method by adding arguments for the request header and annotating them with @WebParam(header=true). I have not tested it with a real web service server, but at least the SOAP message now looks correct (no longer headless).