Skip to content

Adding header element is not reflected in Document [SWS-1087] #1153

@gregturn

Description

@gregturn

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions