How to add SOAP Headers to Spring Jax-WS Client?
问题 How can I add SOAP Headers to Spring Jax-WS Client? Specifically, I have a Jaxb object I would like to add to the header but xml examples would be appreciated. I am using Spring's JaxWsPortProxyFactoryBean described here. Also, I am generating my client as described here which is working less the headers I need to add. Thank you. 回答1: A little bit more elegant (still a class cast is required): public void doWithMessage(WebServiceMessage message) { try { SOAPMessage soapMessage = (