spring-ws
spring-ws copied to clipboard
Adding header element is not reflected in Document [SWS-1087]
Krzysztof Gonia opened SWS-1087 and commented
After calling addHeaderElement method on SoapHeader element changes in header are not reflected document structure.
Code samples:
Let's add element to Header
SoapHeader soapHeader = soapMessage.getSoapHeader();
QName qName = new QName("http://www.w3.org/2005/08/addressing", "Action", "a");
SoapHeaderElement soapHeaderElement = soapHeader.addHeaderElement(qName);
soapHeaderElement.setMustUnderstand(true);
soapHeaderElement.setText("some text");
soapMessage is instance of SaajSoapMessage
Now, after calling soapMessage.getDocument() method this change is not reflected in document structure.
Message that is sent has this element but It cause tests failures when MockWebServiceServer is used. SoapEnvelopeDiffMatcher compares Documents which are different that expected because adding header action is not reflected in document structure.
Affects: 3.0.8