Stephan van Hulst wrote:I think if you want to control what prefixes are used, you can do it by declaring an @XmlSchema annotation on the package itself in package-info.java and configure the xmlns element. The Javadoc has an example: https://docs.oracle.com/javase/10/docs/api/javax/xml/bind/annotation/XmlSchema.html
java.security.NoSuchAlgorithmException: Null or empty transformation
at java.base/javax.crypto.Cipher.getInstance(Cipher.java:526) ~[na:na]
at com.sun.xml.wss.impl.apachecrypto.EncryptionProcessor.encrypt(EncryptionProcessor.java:1052) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.filter.EncryptionFilter.encrypt(EncryptionFilter.java:430) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.filter.EncryptionFilter.process(EncryptionFilter.java:389) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.HarnessUtil.processWSSPolicy(HarnessUtil.java:81) ~[xws-security-3.0.jar:3.0-FCS]
at com.sun.xml.wss.impl.HarnessUtil.processDeep(HarnessUtil.java:252) ~[xws-security-3.0.jar:3.0-FCS]
Kristina Hansen wrote:Well, some of your code tries to initiate a XML cipher. So, look through your code where you call Cipher.getInstance(). Also: What you posted is just the exception message, but an exception always also have a stacktrace - if you don't get one in come catch block there's a printStackTrace() missing - as the stacktrace shows you exactly the information you want to know: where's the call that fails.
Look through all your catch blocks and make sure you have a printStackTrace in each one - this should help you to find the call failing.
Stephan van Hulst wrote:It really should not matter what prefix you use, as long as the prefix is an alias for the correct namespace.
But if you have to change the prefix in order to make the receiver work, then the receiver doesn't know proper XML.
Stephan van Hulst wrote:Why? Assuming the "Enevelope" in the first snippet was just a typo when you wrote your question, the only thing that's different is the namespace prefix.
Do "env" and "Soap" refer to the same namespace?
2019-10-16 10:52:59.296 ERROR 6912 --- [nio-8080-exec-1] j.e.resource.xml.webservices.security : WSS0221: Unable to locate matching certificate for Key Encryption using Callback Handler.
2019-10-16 10:52:59.304 ERROR 6912 --- [nio-8080-exec-1] com.sun.xml.wss.logging.impl.filter : WSS1413: Error extracting certificate
To encrypt outgoing SOAP messages, the security policy file should contain a Encrypt element. This element can further carry a EncryptionTarget element which indicates which part of the message should be encrypted, and a SymmetricKey to indicate that a shared secret instead of the regular public key should be used to encrypt the message. You can read a description of the other elements here .
The XwsSecurityInterceptor will fire a EncryptionKeyCallback to the registered handlers in order to retrieve the encryption information. Within Spring-WS, there is one class which handled this particular callback: the KeyStoreCallbackHandler.
Matt Wong wrote:would be helpfull by posting code causing the issue