I have a WSDL file which can't be imported in Salesforce, so I am currently using the Dom.Document to write my own soap envelope to connect to a webservice.
In my soap envelope I have to set credentials in the soap header:
<soapenv:Header> <soap:HeaderLogin> <soap:username>?</soap:username> <soap:password>?</soap:password> </soap:HeaderLogin> </soapenv:Header>
Preferably I would like to use a NamedCredential to setup authentication for this webservice. But how can I pass this information from the NamedCredential to the soap header?