Description
I observe strange effect by processing custom signature in service inbound chain. End exception is: "Caused by: org.apache.xml.security.exceptions.Base64DecodingException: Error while decoding".
After a bit analyze I found that DigestValue of Signature is concatinated with DigestValue of another signature and therefore cannot be proceed by xml security (santuario).
Additional debugging shows that signature is broken by StaxUtils.copy(node, new SAAJStreamWriter(part)); in SAAJInInterceptor.
Value in node is still correct, but value in SOAPMessage is broken.
I attach a small project to illustrate the issue. Run mvn clean test for the project and compare DigestValue of Signature SIG-7D02FBC5A7AED81312138383830534822 in original request.xml and in output.