I am using Spring-WS and WebServiceTemplate to call SOAP WebService. Currently, i am facing issue while updating SOAP header.
Below is complete structure of SOAP req
Had the same problem and managed to solve it, see here
Basically You can marshal the two elements directly into the soap header like this instead of tying to use a Transformer :
webServiceTemplate.getMarshaller().marshal(element1,soapHeader.getResult());
webServiceTemplate.getMarshaller().marshal(element2,soapHeader.getResult());
The marshaller mentioned here is a "org.springframework.oxm.jaxb.Jaxb2Marshaller" The element 1 and 2 above are the JAXB elements created using the generated Object factory class.
Finally, resolved it !!
I added dummy root while transformation and then removed that dummy root from SOAP Header.