Here you can find the solution for a problem: org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR exception
When you invoke a web service you got the exception like below:
org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.
There is a bug in the wss4j-ws-security-dom library in version 2.2.0 which might be delivered as dependency by SpringBoot freamework.
As as solution you can override the wss4j-ws-security-dom library dependency to higher version for the time it will be included in proper vesion as SpringBoot dependency. For do this – just open pom.xml file and add the following dependency.
<dependency> <groupId>org.apache.wss4j</groupId> <artifactId>wss4j-ws-security-dom</artifactId> <version>2.2.2</version> </dependency>