ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1853590 - /webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
Date Thu, 14 Feb 2019 16:02:49 GMT
Author: coheigea
Date: Thu Feb 14 16:02:49 2019
New Revision: 1853590

URL: http://svn.apache.org/viewvc?rev=1853590&view=rev
Log:
WSS-644 - Error when a SOAP-Fault is thrown with MTOM enabled

Modified:
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java?rev=1853590&r1=1853589&r2=1853590&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
(original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
Thu Feb 14 16:02:49 2019
@@ -395,15 +395,10 @@ public final class EncryptionUtils {
         try {
             document = org.apache.xml.security.utils.XMLUtils.read(new ByteArrayInputStream(bytes),
false);
         } catch (SAXException ex) {
-            // See if a prefix was not bound. Try to fix the DOM Element in this case.
-            if (ex.getMessage() != null && ex.getMessage().startsWith("The prefix")
-                && ex.getMessage().endsWith("is not bound.")) {
-                String fixedElementStr = setParentPrefixes(encData, new String(bytes));
-                document = org.apache.xml.security.utils.XMLUtils.read(
-                    new ByteArrayInputStream(fixedElementStr.getBytes()), false);
-            } else {
-                throw ex;
-            }
+            // A prefix may not have been bound, try to fix the DOM Element in this case.
+            String fixedElementStr = setParentPrefixes(encData, new String(bytes));
+            document = org.apache.xml.security.utils.XMLUtils.read(
+                new ByteArrayInputStream(fixedElementStr.getBytes()), false);
         }
 
         Node decryptedNode =



Mime
View raw message