Details
-
Bug
-
Resolution: Done
-
Major
-
jboss-fuse-6.2.1
-
None
Description
When calling a switchyard soap endpoint which calls a soap proxy webservice and this proxy call results in a SOAPFault, the client produces the error "org.apache.ws.security.WSSecurityException: The signature or decryption was invalid.".
When turning on xmlsec debug logging it is discovered that the "Pre-digested input" of the body-element is different on client and on server side.
It seems that the namespace prefix switchyard uses for the soapfault (SOAP-ENV:Fault) is missing a namespace definition, this definition is removed or is not used when generating the signature.
As clients, the self coded java clients and soapui which both produce the error "org.apache.ws.security.WSSecurityException: The signature or decryption was invalid.".
When adding the namespace manually in the switchyard project in a bean the client can handle the response.
To isolate and clarify the issue I have created some sample projects.
The projects policy-security-wss-signencrypt_proxy and ws_security_sign_enc_policy assumes that the fuse eap is started with a port offset of 300.
The projects should all build with 'mvn clean package' except of course the test client which fails with test failures.
- You should be able to see this test failure with method, `testSYBean_PreserveException()`
Caused by: org.apache.xml.security.encryption.XMLEncryptionException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 212; The prefix "SOAP-ENV" for element "SOAP-ENV:Fault" is not bound. Original Exception was javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 212; The prefix "SOAP-ENV" for element "SOAP-ENV:Fault" is not bound. at org.apache.xml.security.encryption.TransformSerializer.deserialize(TransformSerializer.java:110) at org.apache.xml.security.encryption.TransformSerializer.deserialize(TransformSerializer.java:51) at org.apache.xml.security.encryption.XMLCipher.decryptElement(XMLCipher.java:1750) at org.apache.xml.security.encryption.XMLCipher.decryptElementContent(XMLCipher.java:1781) at org.apache.xml.security.encryption.XMLCipher.doFinal(XMLCipher.java:1031) at org.apache.wss4j.dom.processor.ReferenceListProcessor.decryptEncryptedData(ReferenceListProcessor.java:438) ... 52 more Caused by: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 212; The prefix "SOAP-ENV" for element "SOAP-ENV:Fault" is not bound. at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:749) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:351) at org.apache.xml.security.encryption.TransformSerializer.deserialize(TransformSerializer.java:91) ... 57 more Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 212; The prefix "SOAP-ENV" for element "SOAP-ENV:Fault" is not bound. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:641) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:737) ... 59 more